Search in sources :

Example 1 with PermissionCriteria

use of com.salesmanager.core.model.user.PermissionCriteria in project shopizer by shopizer-ecommerce.

the class SecurityFacadeImpl method getPermissions.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List<ReadablePermission> getPermissions(List<String> groups) {
    List<Group> userGroups = null;
    try {
        userGroups = groupService.listGroupByNames(groups);
        List<Integer> ids = new ArrayList<Integer>();
        for (Group g : userGroups) {
            ids.add(g.getId());
        }
        PermissionCriteria criteria = new PermissionCriteria();
        criteria.setGroupIds(new HashSet(ids));
        PermissionList permissions = permissionService.listByCriteria(criteria);
        throw new ServiceRuntimeException("Not implemented");
    } catch (ServiceException e) {
        e.printStackTrace();
    }
    return null;
}
Also used : PermissionCriteria(com.salesmanager.core.model.user.PermissionCriteria) Group(com.salesmanager.core.model.user.Group) ServiceException(com.salesmanager.core.business.exception.ServiceException) PermissionList(com.salesmanager.core.model.user.PermissionList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException)

Aggregations

ServiceException (com.salesmanager.core.business.exception.ServiceException)1 Group (com.salesmanager.core.model.user.Group)1 PermissionCriteria (com.salesmanager.core.model.user.PermissionCriteria)1 PermissionList (com.salesmanager.core.model.user.PermissionList)1 ServiceRuntimeException (com.salesmanager.shop.store.api.exception.ServiceRuntimeException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1