<div class="form-group"> <label>Can Access Admin</label> <select name="adminaccess" class="form-control"> <?php $opts = array(array('value' => 1, 'text' => 'Allow'), array('value' => 0, 'text' => 'Deny')); echo \Dsc\Html\Select::options($opts, $flash->old('adminaccess')); ?> </select> </div> <!-- /.form-group --> <div class="form-group"> <?php if ($parents = \Users\Models\Roles::find()) { ?> <label>Parent</label> <div> <select name="parent" class="form-control"> <option value="null">None</option> <?php foreach ($parents as $parent) { ?> <?php if (strpos($parent->path, $flash->old('path')) !== false) { // an item cannot be its own descendant continue; } ?>
/** * Returns the permissions assigned to a profile * * @param \Users\Models\Roles $role * @return array */ public function getPermissions(\Users\Models\Roles $role) { $permissions = array(); foreach ($role->getPermissions() as $permission) { $permissions[(string) $permission] = true; } return $permissions; }