Package org.atomojo.auth.service.db

Examples of org.atomojo.auth.service.db.Group


               return new StringRepresentation("Realm with id "+id+" already exists.");
            }
           
            realm = db.createRealm(name,id);
            try {
               Group group = db.createGroup(realm,UUID.randomUUID(),"admin");
               group.addRole(rootRole);
               group.addRole(editorRole);
               Representation responseEntity = new DBObjectRepresentation(MediaType.APPLICATION_XML,realm);
               responseEntity.setCharacterSet(CharacterSet.UTF_8);
               getResponse().setStatus(Status.SUCCESS_CREATED);
               return responseEntity;
            } catch (SQLException ex) {
View Full Code Here


      RealmUserGuard realmByNameGuard = new RealmUserGuard(getContext(),db,null,ChallengeScheme.HTTP_BASIC,"Realm Users",superuser) {
         protected boolean hasRealmSpecific(Request request,RealmUser user)
         {
            // we need to check the group because a user could have realm superuser for another realm
            try {
               Group admin = db.getGroup(user.getRealm(),"admin");
               return user.isMemberOf(admin);
            } catch (SQLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot check role due to database error.",ex);
               return false;
            }
         }
      };
      realmByNameGuard.addPermission(realmSuperuser);
      realmByName.setNext(realmByNameGuard);
      realmByNameGuard.setNext(realmRouter);
     
      Filter realmById = new RealmFilter(getContext(),db);
      mainRouter.attach("/realms/{realm-id}",realmById);
      RealmUserGuard realmByIdGuard = new RealmUserGuard(getContext(),db,null,ChallengeScheme.HTTP_BASIC,"Realm Users",superuser) {
         protected boolean hasRealmSpecific(Request request,RealmUser user)
         {
            try {
               Group admin = db.getGroup(user.getRealm(),"admin");
               return user.isMemberOf(admin);
            } catch (SQLException ex) {
               getContext().getLogger().log(Level.SEVERE,"Cannot check role due to database error.",ex);
               return false;
            }
View Full Code Here

TOP

Related Classes of org.atomojo.auth.service.db.Group

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.