Set the roles that are allowed to view or edit this field on pages.
Applicable only if the Field::flagAccess
is set to this field's flags.
Usage
$field->setRoles(string $type, $roles);
Arguments
Name | Type(s) | Description |
---|---|---|
type | string | Must be either "view" or "edit" |
roles | PageArray, array, null | May be a PageArray of Role objects or an array of Role IDs. |
Exceptions
Method can throw exceptions on error:
WireException
- if given invalid argument
API reference based on ProcessWire core version 3.0.236