removePermissionedFieldsFromFormDefinition()
Overview
public struct function removePermissionedFieldsFromFormDefinition(
required struct formDefinition
, string permissionContext = ""
, array permissionContextKeys
)
Takes a form definition (struct) and removes all the tabs, fieldsets and fields to which the currently logged in admin user does not have permission to edit. Returns a new structure with the potentially removed elements.
Arguments
Name | Type | Required | Description |
---|---|---|---|
formDefinition | struct | Yes | Original form definition (remains untouched by this method) |
permissionContext | string | No (default="") | Optional context for permission lookups (see permissionsservice-haspermission) |
permissionContextKeys | array | No | Optional array of context keys for permission lookups (see permissionsservice-haspermission) |