Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

AclManager API

Problematic edited this page Sep 14, 2011 · 4 revisions

I have some thoughts for the future of the AclManager API; trying to make it as flexible as possible, here are some example uses:

<?php

/*
 * add($permission_mask);
 * to($entity);
 * for($user);
 */
$aclManager->add(MaskBuilder::MASK_OWNER)->to($comment)->for($user);

/*
 * add($user);
 * to($entity);
 * with($permission_mask);
 */
$aclManager->add($user)->to($comment)->with(MaskBuilder::MASK_OWNER)->flush();

/*
 * add($permission_mask);
 * to($user);
 * for($entity);
 */
$aclManager->add(MaskBuilder::MASK_EDIT)->to($user)->for($comment);

Adding null in place of $entity would add class-based permissions.

Clone this wiki locally