@EXT\Route(
"/create/platform_role",
name="claro_admin_create_platform_role",
options={"expose"=true}
)
@EXT\Method("POST")
@EXT\Template("ClarolineCoreBundle:Administration/Roles:createPlatformRoleModalForm.html.twig")

@return array
761892
public function createPlatformRoleAction()
    {
        $form = $this->formFactory->create(FormFactory::TYPE_ROLE_TRANSLATION);
        $form->handleRequest($this->request);

        if ($form->isValid()) {
            $translationKey = $form->get('translationKey')->getData();
            $role = $this->roleManager->createPlatformRoleAction($translationKey);

            return new JsonResponse(
                array(
                    'id' => $role->getId(),
                    'maxUsers' => $role->getMaxUsers(),
                    'translationKey' => $role->getTranslationKey(),
                    'count' => 0
                )
            );
        }

        return array('form' => $form->createView());
    }
1347969
public function getRoles()
    {
        $data  = $this->getData();
        $roles = KObjectConfig::unbox($data->roles);

        if(empty($roles)) {
            $this->getSession()->set('user.roles', JAccess::getAuthorisedViewLevels($this->getId()));
        }

        return parent::getRoles();
    }
558620
public function mailServerFormAction()
    {
        $platformConfig = $this->configHandler->getPlatformConfig();
        $form = $this->formFactory->create(
            new AdminForm\MailServerType(
                $platformConfig->getMailerTransport(),
                $this->configHandler->getLockedParamaters()
            ),
            $platformConfig
        );

        return array('form_mail' => $form->createView());
    }
172527
public function profilePropertiesAction()
    {
        $platformRoles = $this->roleManager->getPlatformNonAdminRoles(false);
        $labels = User::getEditableProperties();
        $properties = $this->profilePropertyManager->getAllProperties();

        return array(
            'platformRoles' => $platformRoles,
            'labels'        => $labels,
            'properties'     => $properties
        );
    }
825383
public function newAction() {

        $entity = new Role();

        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
380243
public function facetsAction()
    {
        $facets = $this->facetManager->getFacets();
        $platformRoles = $this->roleManager->getPlatformNonAdminRoles(true);
        $profilePreferences = $this->facetManager->getProfilePreferences();

        return array(
            'facets' => $facets,
            'platformRoles' => $platformRoles,
            'profilePreferences' => $profilePreferences
        );
    }
1292676
public function buildItemActions()
    {
        $create_route = function (EntityInterface $item) {
            return array(
                'path' => 'KunstmaanFormBundle_formsubmissions_list',
                'params' => array('nodeTranslationId' => $item->getId()),
            );
        };
        $ia = new \Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction(
            $create_route,
            'eye',
            'View'
        );
        $this->addItemAction($ia);
    }
401198
public function getAllowedRoles()
    {
        $returnValue = array();

        $role = new core_kernel_classes_Resource(GenerisRdf::INSTANCE_ROLE_GENERIS);
        $returnValue = array($role->getUri() => $role);

        return (array) $returnValue;
    }
267457
public function create()
    {
        $roles = Role::getAllLists();
        $parents = NavigationAdmin::getAllLists();

        return $this->view('titan::settings.navigation.add_edit')
            ->with('roles', $roles)
            ->with('parents', $parents);
    }
962909
public function onCreateTemplate()
    {
        $type = Request::input('type');
        $template = $this->createTemplate($type);

        if ($type === 'asset') {
            $template->fileName = $this->widget->assetList->getCurrentRelativePath();
        }

        $widget = $this->makeTemplateFormWidget($type, $template);

        $this->vars['templatePath'] = '';

        return [
            'tabTitle' => $this->getTabTitle($type, $template),
            'tab'      => $this->makePartial('form_page', [
                'form'          => $widget,
                'templateType'  => $type,
                'templateTheme' => $this->theme->getDirName(),
                'templateMtime' => null
            ])
        ];
    }
758162
public function loadRoles()
    {
        $data = $this->roleGateway->loadRoles();

        $roles = $this->mapper->mapRoles($data);
        foreach ($roles as $role) {
            foreach ($role->policies as $policy) {
                $this->limitationConverter->toSPI($policy);
            }
        }

        return $roles;
    }
875629
public function userCreationFormAction()
    {
        $roleUser = $this->roleManager->getRoleByName('ROLE_USER');
        $isAdmin = ($this->authorization->isGranted('ROLE_ADMIN')) ? true : false;
        $roles = $this->roleManager->getAllPlatformRoles();
        $unavailableRoles = [];

        foreach ($roles as $role) {
            $isAvailable = $this->roleManager->validateRoleInsert(new User(), $role);

            if (!$isAvailable) {
                $unavailableRoles[] = $role;
            }
        }
        $profileType = new ProfileCreationType(
            $this->localeManager,
            array($roleUser),
            $isAdmin,
            $this->authenticationManager->getDrivers()
        );
        $form = $this->formFactory->create($profileType);

        $error = null;

        if (!$this->mailManager->isMailerAvailable()) {
            $error = 'mail_not_available';
        }

        return array(
            'form_complete_user' => $form->createView(),
            'error' => $error,
            'unavailableRoles' => $unavailableRoles
        );
    }
519392
public function create()
  {
    if ( \Auth::user()->roles[0]->can('menu-create' ) ) {
      $items = $this->menus->pluck('name', 'id')->toarray();
      $roles = Role::pluck('name', 'id')->toarray();
      $selected = [];
      return \View::make('acl::admin.menus.create', [
        'items'    =>  $items,
        'roles'    =>  $roles,
        'selected' =>  $selected,
        'title'    => 'create',
      ]);
    }
    return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
  }
885436
public function getRoles()
    {
        if (count($this->rolesStringAsArray) > 0) {
            return $this->rolesStringAsArray;
        }

        $roleNames = array();

        foreach ($this->getEntityRoles(true) as $role) {
            $roleNames[] = $role->getName();
        }

        return $roleNames;
    }
770117
public function getRoles()
    {
        $this_roles = \Cache::remember(
            'acl.getRolesById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->roles;
            }
        );

        $slugs = method_exists($this_roles, 'pluck') ? $this_roles->pluck('slug','id') : $this_roles->lists('slug','id');
        return is_null($this_roles)
            ? []
            : $this->collectionAsArray($slugs);
    }
915319
public function create()
	{
		if ( Shinobi::can( config('watchtower.acl.role.create', false) ) ) {
			return view( config('watchtower.views.roles.create') )
				->with('route', $this->route);
		}

		return view( config('watchtower.views.layouts.unauthorized'), [ 'message' => 'create new roles' ]);
	}
957884
protected function getRoleSets()
    {
        return Util::getRoleSets($this->getUsername(), new String($this->lookupName), new String($this->rolesQuery), $this);
    }