use of cz.metacentrum.perun.audit.events.FacilityManagerEvents.BanSetForFacility in project perun by CESNET.
the class urn_perun_member_resource_attribute_def_virt_isBannedTest method setUp.
@Before
public void setUp() {
classInstance = new urn_perun_member_resource_attribute_def_virt_isBanned();
session = mock(PerunSessionImpl.class, RETURNS_DEEP_STUBS);
facility = new Facility(1, "testFacility");
resource = new Resource(1, "testResource", "des\nc", 1, 1);
vo = new Vo(1, "testVo", "desc");
user = new User(1, "name", "surname", "middlename", "title", "title");
member = new Member(1, 1, 1, Status.VALID);
isBanned = new Attribute(classInstance.getAttributeDefinition());
event1 = new BanSetForResource(new BanOnResource(), member.getId(), resource.getId());
event2 = new BanUpdatedForResource(new BanOnResource(), member.getId(), resource.getId());
event3 = new BanRemovedForResource(new BanOnResource(), member.getId(), resource.getId());
event4 = new BanSetForFacility(new BanOnFacility(), user.getId(), facility.getId());
event5 = new BanUpdatedForFacility(new BanOnFacility(), user.getId(), facility.getId());
event6 = new BanRemovedForFacility(new BanOnFacility(), user.getId(), facility.getId());
wrongEvent = new SecurityTeamAssignedToFacility();
}
use of cz.metacentrum.perun.audit.events.FacilityManagerEvents.BanSetForFacility in project perun by CESNET.
the class FacilitiesManagerBlImpl method setBan.
@Override
public BanOnFacility setBan(PerunSession sess, BanOnFacility banOnFacility) throws BanAlreadyExistsException {
if (this.banExists(sess, banOnFacility.getUserId(), banOnFacility.getFacilityId()))
throw new BanAlreadyExistsException(banOnFacility);
banOnFacility = getFacilitiesManagerImpl().setBan(sess, banOnFacility);
getPerunBl().getAuditer().log(sess, new BanSetForFacility(banOnFacility, banOnFacility.getUserId(), banOnFacility.getFacilityId()));
return banOnFacility;
}
Aggregations