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

NameTypeRequiredDescription
formDefinitionstructYesOriginal form definition (remains untouched by this method)
permissionContextstringNo (default="")Optional context for permission lookups (see permissionsservice-haspermission)
permissionContextKeysarrayNoOptional array of context keys for permission lookups (see permissionsservice-haspermission)