Package com.claymus

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


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

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

  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

  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

  }

  @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

  @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

TOP

Related Classes of com.claymus.UserRole

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.