Package org.jitterbit.integration.data.access

Examples of org.jitterbit.integration.data.access.Permissions


     * @return a Permissions instance containing the defined permissions, or <tt>null</tt> if this
     *         panel is disabled.
     */
    public Permissions getPermissions() {
        if (allowFullAccessCheck.isSelected()) {
            return new Permissions(FULL_CONTROL, null);
        }
        if (denyFullAccessCheck.isSelected()) {
            return new Permissions(null, FULL_CONTROL);
        }
        EnumSet<Permission> allow = EnumSet.noneOf(Permission.class);
        EnumSet<Permission> deny = EnumSet.noneOf(Permission.class);
        for (PermissionCheckBoxes cb : permissionChecks) {
            cb.apply(allow, deny);
        }
        return new Permissions(allow, deny);
    }
View Full Code Here


        ItemPermissions entries = m_permissionsManager.getItemPermissions(entity);

        // User permissions
        for (UserPermission userEntry : entries.getUserPermissions()) {
            UserId userId = userEntry.roleId;
            Permissions permissions = userEntry.permissions;
            List<CPermission> permissionList = m_userPermissions.get(userId);
            if (permissionList == null) {
                permissionList = Lists.newArrayList();
                m_userPermissions.put(userId, permissionList);
            }
            permissionList.add(new CPermission(entity.getID().toString(), entity.getEntityType().getId(), permissions
                            .getAllowedBits(), permissions.getDeniedBits()));
        }

        // Group permissions
        for (GroupPermission groupEntry : entries.getGroupPermissions()) {
            GroupId groupId = groupEntry.roleId;
            Permissions permissions = groupEntry.permissions;
            List<CPermission> permissionList = m_userPermissions.get(groupId);
            if (permissionList == null) {
                permissionList = Lists.newArrayList();
                m_userPermissions.put(groupId, permissionList);
            }
            permissionList.add(new CPermission(entity.getID().toString(), entity.getEntityType().getId(), permissions
                            .getAllowedBits(), permissions.getDeniedBits()));
        }
    }
View Full Code Here

     * Creates a panel displaying the effective permissions <tt>user</tt> has on <tt>entity</tt>.
     *
     */
    public EffectivePermissionsPanel(PermissionsViewImpl view, IntegrationEntity entity, User user) {
        PermissionsManager mgr = view.getPermissions();
        Permissions perms = mgr.getEffectivePermissions(user, entity);
        createPanel(perms);
    }
View Full Code Here

     * Creates a panel displaying the effective permissions <tt>group</tt> has on <tt>entity</tt>.
     *
     */
    public EffectivePermissionsPanel(PermissionsViewImpl view, IntegrationEntity entity, Group group) {
        PermissionsManager mgr = view.getPermissions();
        Permissions perms = mgr.getEffectivePermissions(group, entity);
        createPanel(perms);
    }
View Full Code Here

     *            the <tt>User</tt> or <tt>Group</tt> for which to get the permissions.
     * @return a <tt>Permissions</tt> instance with the permissions to the accessed entity that
     *         have been set explicitly for <tt>userOrGroup</tt>.
     */
    public Permissions getPermissions(ServerItem userOrGroup) {
        Permissions perms = permissionCache.get(userOrGroup);
        if (perms == null) {
            if (userOrGroup instanceof User) {
                perms = view.getPermissions().getPermissions((User) userOrGroup, accessedEntity);
            } else {
                perms = view.getPermissions().getPermissions((Group) userOrGroup, accessedEntity);
            }
            if (perms == null) {
                perms = new Permissions(DEFAULT_PERMISSION, null);
                permissionCache.put(userOrGroup, perms);
            }
            permissionCache.put(userOrGroup, perms);
        }
        return perms;
View Full Code Here

    public final IntegrationEntityId entityId;
   
    public final Permissions permissions;

    public RolePermission(T roleId, IntegrationEntityId entityId, int allowedBits, int deniedBits) {
        this(roleId, entityId, new Permissions(allowedBits, deniedBits));
    }
View Full Code Here

            }
           
            private boolean checkGroupPermissions() {
                GroupMap gm = groupMaps.get(entity.getEntityType());
                for (Group g : user.getGroups()) {
                    Permissions groupPerms = gm.get(entity.getID(), g.getId());
                    userPerms = Permissions.add(userPerms, groupPerms);
                    if (userPerms != null && userPerms.isEverythingDenied()) {
                        return false;
                    }
                }
View Full Code Here

        List<V> all = Lists.newArrayList();
        for (Map.Entry<IntegrationEntityId, Map<T, Permissions>> e : permissionsMap.entrySet()) {
            IntegrationEntityId entityId = e.getKey();
            for (Map.Entry<T, Permissions> e2 : e.getValue().entrySet()) {
                T roleId = e2.getKey();
                Permissions bits = e2.getValue();
                V v = createRolePermission(entityId, roleId, bits);
                all.add(v);
            }
        }
        return all;
View Full Code Here

                                         T roleId,
                                         IntegrationEntity entity,
                                         Set<IntegrationEntity> cyclicDependencyGuard) {
        cyclicDependencyGuard.add(entity);
        MapImpl<T, V> map = getMap(entity);
        Permissions perms = map.get(entity.getID(), roleId);
        if (perms == null || !perms.isAllowed(Permission.READ)) {
            perms = Permissions.grantRead(perms);
            map.put(entity.getID(), roleId, perms);
            setDirty(entity);
        }
        IntegrationEntity owner = entity.getParent();
View Full Code Here

        if (owner == null) {
            return;
        }
        if (!hasPermission(role, owner, Permission.READ)) {
            MapImpl<T, V> map = getMap(owner);
            Permissions perms = map.get(owner.getID(), roleId);
            if (perms == null) {
                perms = new Permissions(READ_SET, null);
            } else {
                perms = Permissions.add(perms, READ_SET, null);
            }
            set(role, roleId, owner, perms, false);
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.access.Permissions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.