Changeset 5553 for ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java
- Timestamp:
- 08/15/14 16:02:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java
r5552 r5553 48 48 import org.springframework.beans.factory.annotation.Qualifier; 49 49 import org.springframework.dao.DataAccessException; 50 import org.springframework.orm.jpa.vendor.Database; 50 51 import org.springframework.transaction.annotation.Transactional; 51 52 … … 154 155 } 155 156 } 156 157 158 @Override 159 public Number makeGroupMember(String principalName, String groupName) throws UserUnauthorizedException, ItemNotFoundException{ 160 RegistryUser regOwner = userDao.getPrincipalNameById(registryOwner.getId()); 161 if (groupService.isUserOwnerOfGroup(groupName, regOwner.getPrincipalName()) || 162 configuration.isAdminUser(regOwner.getPrincipalName())) { 163 return groupService.makeMember(principalName, groupName); 164 } else { 165 throw new UserUnauthorizedException("The registry owner is not the admin or not the owner of the group and cannot add users to the group"); 166 } 167 } 168 169 // @Override 170 // public long removeGroupMember(String principalName, String groupName) throws UserUnauthorizedException, ItemNotFoundException{ 171 // RegistryUser regOwner = userDao.getPrincipalNameById(registryOwner.getId()); 172 // if (groupService.isUserOwnerOfGroup(groupName, regOwner.getPrincipalName()) || 173 // configuration.isAdminUser(regOwner.getPrincipalName())) { 174 // return groupService.removeMember(principalName, groupName); 175 // } else { 176 // throw new UserUnauthorizedException("The registry owner is not the admin or not the owner of the group and cannot add users to the group"); 177 // } 178 // } 179 180 157 181 @Override 158 182 public List<ProfileDescription> getProfileDescriptions() throws ComponentRegistryException, UserUnauthorizedException { … … 960 984 } 961 985 } 986 987 962 988 }
Note: See TracChangeset
for help on using the changeset viewer.