Ownership where privilege is defined within the object.
More...
#include <ownership.h>
Ownership where privilege is defined within the object.
◆ PrimaryOwnership() [1/2]
| PrimaryOwnership::PrimaryOwnership |
( |
void |
| ) |
|
Default construct ownership: No owner, private access.
◆ PrimaryOwnership() [2/2]
| PrimaryOwnership::PrimaryOwnership |
( |
Type |
rule, |
|
|
User * |
owneruser = nullptr |
|
) |
| |
Construct ownership.
- Parameters
-
| rule | Access policy for non-owners. |
| owneruser | The owner. |
◆ ~PrimaryOwnership()
| PrimaryOwnership::~PrimaryOwnership |
( |
void |
| ) |
|
◆ abandon() [1/2]
| void PrimaryOwnership::abandon |
( |
const User * |
user | ) |
|
Conditionally dissociate ownership.
- Parameters
-
| user | The user attempting dissociation. Dissociation is performed only if this is the user on file. |
◆ abandon() [2/2]
| void PrimaryOwnership::abandon |
( |
void |
| ) |
|
Disassociate ownership from any owner, and mark as disowned.
◆ getOwner()
| User* PrimaryOwnership::getOwner |
( |
void |
| ) |
const |
|
inline |
◆ hasPermission()
| bool PrimaryOwnership::hasPermission |
( |
const User * |
user, |
|
|
Action |
action |
|
) |
| const |
|
overridevirtual |
Determine if a user has permission to use this item in some manner.
- Parameters
-
| user | The user attempting use. |
| action | The type of action the user is performing. |
- Returns
- True if the user owns this item, or the user's chosen access policy allows others to use the item for the requested action.
Implements Ownership.
◆ isOwned()
| bool PrimaryOwnership::isOwned |
( |
void |
| ) |
const |
|
inline |
◆ isOwnedBy()
| bool PrimaryOwnership::isOwnedBy |
( |
const User * |
user | ) |
const |
|
overridevirtual |
Check if we are owned by a user.
- Parameters
-
| user | The user to compare ownership to. |
- Returns
- True if owned by the indicated user, false otherwise.
Implements Ownership.
◆ ownerName()
| const std::string & PrimaryOwnership::ownerName |
( |
void |
| ) |
const |
Retrieve the name of the owner.
- Returns
- The user's name, or text indicating no ownership.
◆ access
◆ owner
| User* PrimaryOwnership::owner = nullptr |
|
private |
The documentation for this class was generated from the following files: