Declares an ability (permission concept) that a Ui5 artifact or module exposes. This is purely metadata discovered by reflection; Core does not enforce any authorization.
Each ability is defined by a unique name and a {@see AbilityType}. The resulting i18n keys for UI labels are composed automatically as:
• "
Example:
use LaravelUi5\Core\Attributes\Ability;
use LaravelUi5\Core\Enums\AbilityType;
#[Ability(
name: 'exportContacts',
role: 'Supervisor',
type: AbilityType::Act,
note: 'Allows exporting contact data to CSV or Excel.'
)]
class ExportContactsAction extends Ui5Action
{
// ...
}
During cache build the SDK records:
The SDK or higher layers may later map these abilities to Laravel authorization gates or policy methods and resolve the derived i18n keys for display.
| Methods | ||
|---|---|---|
public
|
__construct(string $ability, string $role, AbilityType $type = AbilityType::Act, string $note)
|
# |
| Properties | |||
|---|---|---|---|
public
|
string
|
$ability
|
# |
public
|
string
|
$role
|
# |
public
|
AbilityType
|
$type
|
# |
public
|
string
|
$note
|
# |