1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Node Permissions

Discussion in 'XenForo Development Discussions' started by ragtek, May 30, 2011.

  1. ragtek

    ragtek Guest

    Is there a way to access "all permissions" for pages?

    I've created a page and set ALL permissions (can view, forum perms ,forum mod perms,gallery perms, article perms,...)

    If i try to access the perms via
    PHP:
      public function canEditComment(array $comment,&$errorPhraseKey '', array $nodePermissions null, array $viewingUser null)
        {
            
    $this->standardizeViewingUserReferenceForNode($comment['node_id'], $viewingUser$nodePermissions);

            if (!
    $viewingUser['user_id'])
            {
                return 
    false;
            }

            if (
    XenForo_Permission::hasContentPermission($nodePermissions'editAnyPost'))
            {
                return 
    true;
            }

            if (
    $comment['user_id'] == $viewingUser['user_id'] && XenForo_Permission::hasContentPermission($nodePermissions'editOwnPost'))
            {
    BUT the only perm i can access here is the "view permission"
    Is this because of the nodetype permission_group_id ?
    Can I manipulate this?

    I've finished my xenforo page comment system, but i'm not able to set the permissions, because i can access only the view permission
     
    Digital Doctor likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    Node types (can) have a permission group attached to them. The only permissions exposed on a per node basis are in that group.

    You'll need to set the permission group for pages to the group that you need and then it should become available.
     
  3. ragtek

    ragtek Guest

    So i need to edit the permission_group_id value in xf_node_type to forum?

    hm, i think i have to find an other way for this, i don't want to change original xenforo values:D
     
  4. Mike

    Mike XenForo Developer Staff Member

    Or you just use global permissions.
     
  5. ragtek

    ragtek Guest

    Global Permissions aren't possible because i want to define them for the page node.
    (can view page, can manage page comments, can create page comments, can edit own page comments, can edit all page comments,..)

    What could be the worst case scenario, if i change the original group id?

    if you upgrade this in an future release, it would break the page node permissions, until i release a new addon version with the upgraded node permissions, right?
     
  6. Mike

    Mike XenForo Developer Staff Member

    I believe that would be all that happened.
     

Share This Page