Examples of Roles


Examples of org.apache.wicket.authroles.authorization.strategies.role.Roles

        this.version = version;
    }

    public void setEntitlements(final String[] entitlements) {
        String[] defensiveCopy = entitlements.clone();
        roles = new Roles(defensiveCopy);
    }
View Full Code Here

Examples of org.apache.wicket.authroles.authorization.strategies.role.Roles

    }

    @Override
    public Roles getRoles() {
        if (isSignedIn()) {
            return new Roles("ROLE_USER");
        } else {
            return new Roles();
        }
    }
View Full Code Here

Examples of org.apache.wicket.authroles.authorization.strategies.role.Roles

    }

    //FIXME: MZA: Modification of returning object - it would be better if roles were returned
    @Override
    public Roles getRoles() {
        Roles roles = new Roles();
        getRolesIfSignedIn(roles);
        return roles;
    }
View Full Code Here

Examples of org.jboss.as.console.client.administration.role.model.Roles

            dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
                @Override
                public void onSuccess(final DMRResponse response) {
                    Principals principals = new Principals();
                    RoleAssignments assignments = new RoleAssignments();
                    Roles roles = new Roles();

                    ModelNode result = response.get();
                    if (result.isFailure()) {
                        control.getContext().put(Results.ERROR,
                                new RuntimeException("Failed to load contents: " + result.getFailureDescription()));
View Full Code Here

Examples of org.jboss.resteasy.keystone.model.Roles

      MessageDigest digest = MessageDigest.getInstance("MD5");
      String hashPassword = Base64.encodeBytes(digest.digest(password.getBytes("UTF-8")));
      String savedPassword = user.getCredentials().get("password-hash");
      if (!hashPassword.equals(savedPassword)) throw new WebApplicationException(401);

      Roles roles = projects.getUserRoles(projectId, userId);
      if (roles == null || roles.getRoles().size() < 1) throw new WebApplicationException(403);

      String tokenId = UUID.randomUUID().toString();
      long expMillis = expirationUnit.toMillis(expiration);
      Calendar expires = Calendar.getInstance();
      expires.setTime(new Date(System.currentTimeMillis() + expMillis));
      Access.Token token = new Access.Token(tokenId, expires, project);
      Access.User userInfo = new Access.User(user.getId(), user.getName(), user.getUsername(), roles.getRoles());
      Access access = new Access(token, null, userInfo, null);
      cache.put("/tokens/" + tokenId, access, expiration, expirationUnit);
      return access;
   }
View Full Code Here

Examples of org.olat.core.id.Roles

  /**
   * @return Roles
   */
  public Roles getRoles() {
    Roles result = identityEnvironment.getRoles();
    if (result==null) {
      Tracing.logWarn("getRoles: null, this="+this, new RuntimeException("getRoles"), UserSession.class);
    }
    return result;
  }
View Full Code Here

Examples of org.olat.core.id.Roles

    Tracing.logAudit("All sessions were invalidated by an administrator", UserSession.class);
    //clusterNOK ?? invalidate only locale sessions ?
    Set iterCopy = new HashSet(authUserSessions);
    for (Iterator iterator = iterCopy.iterator(); iterator.hasNext();) {
      UserSession userSession = (UserSession) iterator.next();
      Roles userRoles = userSession != null ? userSession.getRoles() : null;
      if (userRoles != null && !userRoles.isOLATAdmin()) {
        //do not logout administrators
        try {
          userSession.signOffAndClear();
          invalidateCounter++;
        } catch(Exception ex) {
View Full Code Here

Examples of org.olat.core.id.Roles

      || ! ureq.getUserSession().isAuthenticated()
      || contextHelpPageVC == null ) return;
   
    CommentAndRatingService commentAndRatingService = (CommentAndRatingService) ServiceFactory.getServiceOrNull(CommentAndRatingService.class);
    if (commentAndRatingService != null) {       
      Roles roles = ureq.getUserSession().getRoles();
      OLATResourceable helpOres = OresHelper.createOLATResourceableType("contexthelp");
      String key = ContextHelpManager.getInstance().calculateCombinedKey(pageTranslator.getLocale(), bundleName, page);
      commentAndRatingService.init(getIdentity(), helpOres, key, roles.isOLATAdmin(), roles.isGuestOnly());
      UserCommentsAndRatingsController commentsAndRatingCtr = commentAndRatingService.createUserCommentsAndRatingControllerExpandable(ureq, getWindowControl());
      listenTo(commentsAndRatingCtr);
      contextHelpWrapperVC.put("commentsAndRatingCtr", commentsAndRatingCtr.getInitialComponent());   
    }
  }
View Full Code Here

Examples of org.olat.core.id.Roles

    if (allowsGuestAccess(course)) {
      hasAccess = true;
    } else {
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      ienv.setRoles(roles);
      UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      // Build an evaluation tree
      TreeEvaluation treeEval = new TreeEvaluation();
      NodeEvaluation nodeEval = node.eval(userCourseEnv.getConditionInterpreter(), treeEval);
View Full Code Here

Examples of org.olat.core.id.Roles

    if (allowsGuestAccess(feed)) {
      hasAccess = true;
    } else if (identity != null) {
      RepositoryManager resMgr = RepositoryManager.getInstance();
      RepositoryEntry repoEntry = resMgr.lookupRepositoryEntry(feed, false);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      boolean isAllowedToLaunch = resMgr.isAllowedToLaunch(identity, roles, repoEntry);
      if (isAllowedToLaunch && validAuthentication(identity, token)) {
        hasAccess = true;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.