use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class GroupServiceTest method should_raise_exception_on_delete_reserved_group.
@Test(expected = ValidationConflictException.class)
public void should_raise_exception_on_delete_reserved_group() throws JsonProcessingException {
Group group = new Group();
group.setName(Group.ADMINS_GROUP_NAME);
when(groupManager.getGroup(group.getName())).thenReturn(group);
this.groupService.removeGroup(group.getName());
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class ActivityStreamAction method groupsToStringCode.
private List<String> groupsToStringCode(List<Group> groups) {
List<String> groupCodes = new ArrayList<String>();
for (int i = 0; i < groups.size(); i++) {
Group group = groups.get(i);
groupCodes.add(group.getName());
}
return groupCodes;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class ActivityStreamAction method viewMore.
public String viewMore() {
List<Integer> actionRecordIds = new ArrayList<Integer>();
try {
Date timestamp = this.getTimestamp();
ActivityStreamSeachBean searchBean = new ActivityStreamSeachBean();
List<Group> userGroups = this.getAuthorizationManager().getUserGroups(this.getCurrentUser());
searchBean.setUserGroupCodes(groupsToStringCode(userGroups));
if (timestamp != null) {
timestamp.setTime(timestamp.getTime() - 100);
}
searchBean.setEndCreation(timestamp);
actionRecordIds = this.getActionLogManager().getActionRecords(searchBean);
} catch (Throwable t) {
_logger.error("Error on loading more activities", t);
}
this.setActionRecordIds(actionRecordIds);
return SUCCESS;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class UserAuthorizationAction method getGroups.
public List<Group> getGroups() {
List<Group> groups = this.getGroupManager().getGroups();
Collections.sort(groups, new BeanComparator("description"));
return groups;
}
use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.
the class TestExtendedResourceAction method testNewImageResource_1.
public void testNewImageResource_1() throws Throwable {
// Contenuto FREE
this.executeEdit("ART1", "admin");
String contentOnSessionMarker = super.extractSessionMarker("ART1", ApsAdminSystemConstants.EDIT);
// iniziazione parametri sessione
HttpSession session = this.getRequest().getSession();
session.setAttribute(ResourceAttributeActionHelper.ATTRIBUTE_NAME_SESSION_PARAM, "Foto");
session.setAttribute(ResourceAttributeActionHelper.RESOURCE_TYPE_CODE_SESSION_PARAM, "Image");
session.setAttribute(ResourceAttributeActionHelper.RESOURCE_LANG_CODE_SESSION_PARAM, "it");
this.initContentAction("/do/jacms/Content/Resource", "new", contentOnSessionMarker);
// per replicare il chain in occasione dei chooseResource da edit Contenuto.
this.addParameter("resourceTypeCode", "Image");
String result = this.executeAction();
assertEquals(Action.SUCCESS, result);
ExtendedResourceAction action = (ExtendedResourceAction) this.getAction();
List<Group> allowedGroup = action.getAllowedGroups();
assertEquals(1, allowedGroup.size());
}
Aggregations