public static function getProfileAcl($profile)
    {
        $acl            = new AclLibrary();
        // get all resources in application
        $resources      = Resource::all();
        // get all permissions fron this profile
        $permissions    = Permission::getRecord($profile);

        // set profile id
        $acl->addRole(new Role($profile));

        // add resources to acl element
        foreach($resources as $resource)
            $acl->addResource(new AclResource($resource->id_007));

        // add resources to acl element
        foreach($permissions as $permission)
            $acl->allow($profile, $permission->resource_id_009, $permission->action_id_009);

        return $acl;
    }
public static function getProfileAcl($profile)
    {
        $acl            = new AclLibrary();
        // get all resources in application
        $resources      = Resource::all();
        // get all permissions fron this profile
        $permissions    = Permission::getRecord($profile);

        // set profile id
        $acl->addRole(new Role($profile));

        // add resources to acl element
        foreach($resources as $resource)
            $acl->addResource(new AclResource($resource->id_007));

        // add resources to acl element
        foreach($permissions as $permission)
            $acl->allow($profile, $permission->resource_id_009, $permission->action_id_009);

        return $acl;
    }
public static function getProfileAcl ( $ profile ) { $ acl = new AclLibrary ( ) ; // get all resources in application $ resources = Resource :: all ( ) ; // get all permissions fron this profile $ permissions = Permission :: getRecord ( $ profile ) ; // set profile id $ acl -> addRole ( new Role ( $ profile ) ) ; // add resources to acl element foreach ( $ resources as $ resource ) $ acl -> addResource ( new AclResource ( $ resource -> id_007 ) ) ; // add resources to acl element foreach ( $ permissions as $ permission ) $ acl -> allow ( $ profile , $ permission -> resource_id_009 , $ permission -> action_id_009 ) ; return $ acl ; }
Function instance the acl of a particular profile

@access	public
@param   integer     $profile
@return	\Zend\Permissions\Acl\Acl
Function instance the acl of a particular profile