It's possible to set differt permission from first table on relationship.
E.g. on first Table User can edit, but on relation User can only view!
Permission on ralationship
3 posts
• Page 1 of 1
Hi, Yes, this is possible.Ê If you want all relationships for a record to have the same permissions, then you can achieve this by NOT allowing the following permissions:add new related record add existing related record remove related record delete related record One way to achieve this is by adding a permissions.ini file to your application's directory, and create a role that inherits from ADMIN but disallows these permissions.Ê e.g. [MY_ROLE extends ADMIN] add new related record=0 add existing related record=0 remove related record=0 delete related record=0 Then in your getPermissions() method you would just return the permissions for this role: function getPermissions(&$record){ ÊÊÊ return Dataface_PermissionsTool::getRolePermissions('MY_ROLE'); } If you want these permissions to only apply to a particular relationship then you could assign the permissions inside the method: rel_%%RELATIONSHIP_NAME%%__permissions() e.g. If the relationship is named foo, you could do: function rel_foo__permissions(&$record){ ÊÊÊÊ return Dataface_PermissionsTool::getRolePermissions('MY_ROLE'); } Note that you would also want to set the permissions on the related table to disallow editing of those related records. -Steve
3 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 33 guests |