Examples of UserRole


Examples of adios.model.UserRole

    User u;
   
    try {
      Log.info(":::  insert user roles");
      UserRole role = new UserRole("ROLE_ADMIN");
      userRoleDao.persist(role);
      role = new UserRole("ROLE_USER");
      userRoleDao.persist(role);
    } catch (Exception es) {
      Log.error("exception, already in database");
    }
View Full Code Here

Examples of com.brienwheeler.svc.users.domain.UserRole

    }
   
    for (String role : roles)
    {
      if (!userRoleListContains(currentRoles, role))
        userRoleDao.save(new UserRole(user, role));
    }
  }
View Full Code Here

Examples of com.claymus.UserRole

  @Override
  public String[][] getRoles() {
    List<UserRole> userRoles = UserData.getUserRoles();
    String[][] roleList = new String[userRoles.size()][2];
    for(int i = 0; i < userRoles.size(); i++) {
      UserRole userRole = userRoles.get(i);
      roleList[i][0] = KeyFactory.keyToString(userRole.getKey());
      roleList[i][1] = userRole.getName();
    }
    return roleList;
  }
View Full Code Here

Examples of com.claymus.UserRole

public class AdministerServiceImpl extends RemoteServiceServlet implements AdministerService {

  @Override
  public void setModuleAccessLevel(String moduleId, String encoded, int accessLevel) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    UserRole userRole = UserData.getUser().getRole();

    if(module.getAccessLevel(userRole) < ModuleHelper.VIEW_N_EDIT)
      throw new UserException();

    module = ModuleData.getModule(moduleId);
View Full Code Here

Examples of com.claymus.UserRole

public class ThemeServiceImpl extends RemoteServiceServlet implements ThemeService {

  @Override
  public void setActive(String className) throws ServerException, UserException {
    Module module = ModuleData.getModule(ModuleHelper.class);
    UserRole userRole = UserData.getUser().getRole();

    if(module.getAccessLevel(userRole) != ModuleHelper.VIEW_N_CHANGE)
      throw new UserException();

    if(! ThemeData.setTheme(ThemeData.getTheme(className)))
View Full Code Here

Examples of com.claymus.UserRole

  protected String getHTML() {
    ClaymusMain.getResponse().setStatus(401);

    String html = "";

    UserRole userRole = UserData.getUser().getRole();
    if(userRole.equals(UserData.getGuestRole())) {
      html += "<div class='claymus-h1'>Login Required !!!</div>";

      html += "<div class='claymus-t1'>";
      html += "<p><a href='" + UserData.getLoginURL() + "'>Login</a> is required to view content of this page.</p>";
      html += "</div>";
View Full Code Here

Examples of com.claymus.UserRole

  protected void doRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    String uri = req.getRequestURI();
    Page page = null;
    List<List<Content>> contents = null;
    User user = UserData.getUser();
    UserRole userRole = user.getRole();
    Key userRoleKey = userRole.getKey();

    if(uri.startsWith("/_ah/")) { // Administer pages
      String str = uri.substring(5);
      String moduleId = str.split("/")[0];
View Full Code Here

Examples of com.claymus.UserRole

  }

  @Override
  protected String getHTML() {
    List<UserRole> userRoles = UserData.getUserRoles();
    UserRole adminRole = UserData.getAdministratorRole();

    String html = "<div class='claymus-h1'>" + getName() + "</div>";

    html += "<table class='claymus-formatted-table'>";
View Full Code Here

Examples of com.claymus.UserRole

  @Override
  public String[][] getRoles(){
    List<UserRole> userRoles = UserData.getUserRoles();
    String[][] roleList = new String[userRoles.size()][2];
    for(int i = 0; i < userRoles.size(); i++) {
      UserRole userRole = userRoles.get(i);
      roleList[i][0] = KeyFactory.keyToString(userRole.getKey());
      roleList[i][1] = userRole.getName();
    }
    return roleList;
  }
View Full Code Here

Examples of com.commafeed.backend.model.UserRole

      u.setDisabled(!userModel.isEnabled());
      userDAO.saveOrUpdate(u);

      Set<Role> roles = userRoleDAO.findRoles(u);
      if (userModel.isAdmin() && !roles.contains(Role.ADMIN)) {
        userRoleDAO.saveOrUpdate(new UserRole(u, Role.ADMIN));
      } else if (!userModel.isAdmin() && roles.contains(Role.ADMIN)) {
        if (CommaFeedApplication.USERNAME_ADMIN.equals(u.getName())) {
          return Response.status(Status.FORBIDDEN).entity("You cannot remove the admin role from the admin user.").build();
        }
        for (UserRole userRole : userRoleDAO.findAll(u)) {
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.