Esempio n. 1
0
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access
defined('_HZEXEC_') or die;
$tmpl = Request::getVar('tmpl', '');
$canDo = \Components\Groups\Helpers\Permissions::getActions('group');
Toolbar::title(Lang::txt('COM_GROUPS') . ': ' . Lang::txt('COM_GROUPS_ROLES'), 'groups.png');
if ($canDo->get('core.create')) {
    Toolbar::addNew();
}
if ($canDo->get('core.edit')) {
    Toolbar::editList();
}
if ($canDo->get('core.delete')) {
    Toolbar::deleteList('COM_GROUPS_DELETE_CONFIRM', 'delete');
}
Toolbar::spacer();
Toolbar::help('groups');
Html::behavior('tooltip');
?>
<script type="text/javascript">
Esempio n. 2
0
 /**
  * Authorization check
  * Checks if the group is a system group and the user has super admin access
  *
  * @param     object $group \Hubzero\User\Group
  * @return    boolean True if authorized, false if not.
  */
 protected function authorize($task, $group = null)
 {
     // get users actions
     $canDo = Permissions::getActions('group');
     // build task name
     $taskName = 'core.' . $task;
     // can user perform task
     if (!$canDo->get($taskName) || !$canDo->get('core.admin') && $task == 'edit' && $group->get('type') == 0) {
         // No access - redirect to main listing
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_GROUPS_NOT_AUTH'), 'error');
         return false;
     }
     return true;
 }
Esempio n. 3
0
 /**
  * Authorization check
  * Checks if the group is a system group and the user has super admin access
  *
  * @param   object   $group  \Hubzero\User\Group
  * @return  boolean  True if authorized, false if not.
  */
 protected function authorize($task, $group = null)
 {
     // get users actions
     $canDo = Permissions::getActions('group');
     // build task name
     $taskName = 'core.' . $task;
     // can user perform task
     if (!$canDo->get($taskName) || !$canDo->get('core.admin') && $task == 'edit' && $group->get('type') == 0) {
         // No access
         return false;
     }
     return true;
 }