getPermissionLevel function

Discuss about Group-Office development here

Moderator: Developers

richarddodd
Posts: 66
Joined: Fri Jun 21, 2013 2:55 pm

getPermissionLevel function

Postby richarddodd » Thu May 01, 2014 5:18 pm

Hi

I'm currently trying to work out how to set up acl permissions for a tree, where I want to use different permissions depending on whether I'm adding to the root node, or to a child. My aclField is 'category.acl_id' (same as notes for instance).

My question is, how does the function getPermissionLevel work?? Specifically the line

Code: Select all

if(empty($this->{$this->aclField()}) && !$this->joinAclField) {
 
. I cannot see how this is going to work, because it is going to access `$this->category.acl_id`, which should throw an error as 'category.acl_id' isn't a valid field! What I have found is that if I include a watch expression for

Code: Select all

$this->{$this->aclField()} 
in xdebug suddenly it throws the error I was expecting.

So all in all I'm very confused. I don't know if you have any insights into this?
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: getPermissionLevel function

Postby mschering » Thu May 08, 2014 6:51 am

It resolves category.acl_id in the relation. It finds $this->category->acl_id.
Best regards,

Merijn Schering
Intermesh
richarddodd
Posts: 66
Joined: Fri Jun 21, 2013 2:55 pm

Re: getPermissionLevel function

Postby richarddodd » Sun May 11, 2014 12:53 pm

This is probably a problem with my understanding of PHP, but doesn't it try to resolve to `$this->category.acl_id`, or does it automatically convert '.' to '->'?
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: getPermissionLevel function

Postby mschering » Wed May 14, 2014 7:35 am

Yes, it auto converts it.
Best regards,

Merijn Schering
Intermesh
richarddodd
Posts: 66
Joined: Fri Jun 21, 2013 2:55 pm

Re: getPermissionLevel function

Postby richarddodd » Fri May 16, 2014 5:10 pm

dank je!

Who is online

Users browsing this forum: No registered users and 2 guests

cron