public static Group getRoleGroup(Context context, int collectionId, Role role) throws SQLException {
if(role.getScope() == Role.Scope.REPOSITORY){
return Group.findByName(context, role.getName());
}else
if(role.getScope() == Role.Scope.COLLECTION){
CollectionRole collectionRole = CollectionRole.find(context, collectionId, role.getId());
if(collectionRole == null)
return null;
return collectionRole.getGroup();
}else
if(role.getScope() == Role.Scope.ITEM){
}
return null;