src/BoomCMS/Database/Models/Group.php
public function addRole($roleId, $allowed, $pageId = 0)
    {
        if (!$this->hasRole($roleId, $pageId)) {
            $this->roles()
                ->attach($roleId, [
                    self::PIVOT_ATTR_ALLOWED => $allowed,
                    self::PIVOT_ATTR_PAGE_ID => $pageId,
                ]);
        }

        return $this;
    }
public function addRole($roleId, $allowed, $pageId = 0)
    {
        if (!$this->hasRole($roleId, $pageId)) {
            $this->roles()
                ->attach($roleId, [
                    self::PIVOT_ATTR_ALLOWED => $allowed,
                    self::PIVOT_ATTR_PAGE_ID => $pageId,
                ]);
        }

        return $this;
    }
public function addRole ( $ roleId , $ allowed , $ pageId = 0 ) { if ( ! $ this -> hasRole ( $ roleId , $ pageId ) ) { $ this -> roles ( ) -> attach ( $ roleId , [ self :: PIVOT_ATTR_ALLOWED => $ allowed , self :: PIVOT_ATTR_PAGE_ID => $ pageId , ] ) ; } return $ this ; }
Adds a role to the current group.

This will also add the role to all members of the group.


@param int $roleId  ID of the role to add
@param int $allowed Whether the group is allowed or prevented from the role.
@param int $pageId  Make the role active at a particular point in the page tree.

@return $this
Adds a role to the current group .