Search in sources :

Example 1 with GroupNotAdminException

use of cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException in project perun by CESNET.

the class FacilitiesManagerBlImpl method removeAdmin.

@Override
public void removeAdmin(PerunSession sess, Facility facility, Group group) throws InternalErrorException, GroupNotAdminException {
    List<Group> listOfAdmins = getAdminGroups(sess, facility);
    if (!listOfAdmins.contains(group))
        throw new GroupNotAdminException(group);
    AuthzResolverBlImpl.unsetRole(sess, group, facility, Role.FACILITYADMIN);
    getPerunBl().getAuditer().log(sess, "Group {} was removed from admins of {}.", group, facility);
}
Also used : Group(cz.metacentrum.perun.core.api.Group) ContactGroup(cz.metacentrum.perun.core.api.ContactGroup) GroupNotAdminException(cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException)

Example 2 with GroupNotAdminException

use of cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException in project perun by CESNET.

the class VosManagerBlImpl method removeAdmin.

@Override
public void removeAdmin(PerunSession sess, Vo vo, Group group) throws InternalErrorException, GroupNotAdminException {
    List<Group> adminsOfVo = this.getAdminGroups(sess, vo);
    if (!adminsOfVo.contains(group))
        throw new GroupNotAdminException(group);
    AuthzResolverBlImpl.unsetRole(sess, group, vo, Role.VOADMIN);
    log.debug("Group [{}] deleted like administrator from VO [{}]", group, vo);
}
Also used : Group(cz.metacentrum.perun.core.api.Group) GroupNotAdminException(cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException)

Aggregations

Group (cz.metacentrum.perun.core.api.Group)2 GroupNotAdminException (cz.metacentrum.perun.core.api.exceptions.GroupNotAdminException)2 ContactGroup (cz.metacentrum.perun.core.api.ContactGroup)1