Search in sources :

Example 31 with Group

use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.

the class ContentAction method removeGroup.

/**
 * Esegue l'azione di rimozione di un gruppo dal contenuto in fase di
 * redazione.
 *
 * @return Il codice del risultato dell'azione.
 */
public String removeGroup() {
    this.updateContentOnSession();
    try {
        String extraGroupName = this.getExtraGroupName();
        Group group = this.getGroupManager().getGroup(extraGroupName);
        if (null != group) {
            this.getContent().getGroups().remove(group.getName());
        }
    } catch (Throwable t) {
        _logger.error("error in removeGroup", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : Group(com.agiletec.aps.system.services.group.Group)

Example 32 with Group

use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.

the class ExtendedResourceAction method getGroupCodesForSearch.

protected List<String> getGroupCodesForSearch() {
    List<Group> groups = this.getAllowedGroups();
    List<String> codesForSearch = new ArrayList<String>();
    for (int i = 0; i < groups.size(); i++) {
        Group group = groups.get(i);
        codesForSearch.add(group.getName());
    }
    return codesForSearch;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) ArrayList(java.util.ArrayList)

Example 33 with Group

use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.

the class GroupFinderAction method getGroups.

public List<Group> getGroups() {
    List<Group> groups = this.getGroupManager().getGroups();
    BeanComparator comparator = new BeanComparator("descr");
    Collections.sort(groups, comparator);
    return groups;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Example 34 with Group

use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.

the class PageFinderAction method getAllowedGroupCodes.

private List<String> getAllowedGroupCodes() {
    List<String> allowedGroups = new ArrayList<String>();
    UserDetails currentUser = this.getCurrentUser();
    List<Group> userGroups = this.getAuthorizationManager().getUserGroups(currentUser);
    Iterator<Group> iter = userGroups.iterator();
    while (iter.hasNext()) {
        Group group = iter.next();
        allowedGroups.add(group.getName());
    }
    return allowedGroups;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) UserDetails(com.agiletec.aps.system.services.user.UserDetails) ArrayList(java.util.ArrayList)

Example 35 with Group

use of com.agiletec.aps.system.services.group.Group in project entando-core by entando.

the class BaseAction method getActualAllowedGroupCodes.

protected List<String> getActualAllowedGroupCodes() {
    List<String> codes = new ArrayList<String>();
    List<Group> groups = this.getActualAllowedGroups();
    for (int i = 0; i < groups.size(); i++) {
        Group group = groups.get(i);
        if (null != group && !codes.contains(group.getName())) {
            codes.add(group.getName());
        }
    }
    return codes;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) ArrayList(java.util.ArrayList)

Aggregations

Group (com.agiletec.aps.system.services.group.Group)68 UserDetails (com.agiletec.aps.system.services.user.UserDetails)15 Role (com.agiletec.aps.system.services.role.Role)13 ArrayList (java.util.ArrayList)13 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)7 BeanComparator (org.apache.commons.beanutils.BeanComparator)5 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)4 HashSet (java.util.HashSet)4 RestRourceNotFoundException (org.entando.entando.aps.system.exception.RestRourceNotFoundException)4 RestServerError (org.entando.entando.aps.system.exception.RestServerError)4 IGroupManager (com.agiletec.aps.system.services.group.IGroupManager)3 DataObject (org.entando.entando.aps.system.services.dataobject.model.DataObject)3 AttributeRole (com.agiletec.aps.system.common.entity.model.attribute.AttributeRole)2 SearcherDaoPaginatedResult (com.agiletec.aps.system.common.model.dao.SearcherDaoPaginatedResult)2 Authorization (com.agiletec.aps.system.services.authorization.Authorization)2 IAuthorizationManager (com.agiletec.aps.system.services.authorization.IAuthorizationManager)2 ExtendedResourceAction (com.agiletec.plugins.jacms.apsadmin.content.attribute.action.resource.ExtendedResourceAction)2 Date (java.util.Date)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2