Package org.apache.wicket.authroles.authorization.strategies.role

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


   * @see IRoleCheckingStrategy#hasAnyRole(Roles)
   */
  @Override
  public final boolean hasAnyRole(final Roles roles)
  {
    final Roles sessionRoles = AbstractAuthenticatedWebSession.get().getRoles();
    return (sessionRoles != null) && sessionRoles.hasAnyRole(roles);
  }
View Full Code Here


    public Roles getRoles() {
        if (!isSignedIn()) {
            return null;
        }
        final List<String> roles = authenticationSession.getRoles();
        return new Roles(roles.toArray(new String[] {}));
    }
View Full Code Here

        this.coreVersion = coreVersion;
    }

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

        return false;
    }

    @Override
    public Roles getRoles() {
        Roles roles = new Roles();
      
        if (isSignedIn())
        {
            if (checkAdmin){
                roles.add("LIBRARIAN");
            }
            roles.add("USER");
        }
        return roles;

    }
View Full Code Here

    } catch (RestartResponseAtInterceptPageException e) {
      throw e;
    } catch (Exception e) {
      //no-op, will continue to sign-in page
    }
    Roles r = null;
    if (externalType != null) {
      invalidate();
    }
    if (isSignedIn()) {
      r = new Roles(Roles.USER);
      if (checkAdminLevel(userLevel)) {
        r.add(Roles.ADMIN);
      }
    }
    return r;
  }
View Full Code Here

        this.version = version;
    }

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

        this.coreVersion = coreVersion;
    }

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

    SID = null;
  }
 
  @Override
  public Roles getRoles() {
    Roles r = null;
    if (isSignedIn()) {
      userLevel = Application.getBean(UserManager.class).getUserLevelByID(userId);
      AuthLevelUtil authLevel = Application.getBean(AuthLevelUtil.class);
      r = new Roles(Roles.USER);
      if (authLevel.checkUserLevel(userLevel)) {
        r.add(Roles.USER);
      }
      if (authLevel.checkAdminLevel(userLevel)) {
        r.add(Roles.ADMIN);
      }
    }
    return r;
  }
View Full Code Here

    } catch (RestartResponseAtInterceptPageException e) {
      throw e;
    } catch (Exception e) {
      //no-op, will continue to sign-in page
    }
    Roles r = null;
    if (externalType != null) {
      invalidate();
    }
    if (isSignedIn()) {
      r = new Roles(Roles.USER);
      if (AuthLevelUtil.checkAdminLevel(userLevel)) {
        r.add(Roles.ADMIN);
      }
    }
    return r;
  }
View Full Code Here

      //no-op, will continue to sign-in page
    }
    if (rights.isEmpty()) {
      isSignedIn();
    }
    Roles r = new Roles();
    for (Right right : rights) {
      r.add(right.name());
    }
    return r;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.authroles.authorization.strategies.role.Roles

Copyright © 2018 www.massapicom. 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.