Package org.nxplanner.security.auth

Examples of org.nxplanner.security.auth.Permission


    private void addRoleAssociation(Session session, int roleId, int personId, int projectId) throws HibernateException {
        session.save(new RoleAssociation(projectId, personId, roleId));
    }

    private void createPermission(Session session, Role sysadminRole, String resourceType, String permissionName) throws HibernateException {
        Permission permission = new Permission(resourceType, 0, sysadminRole.getId(), permissionName);
        session.save(permission);
    }
View Full Code Here


                    Project project = (Project)projects.get(i);
                    Role role = getRole(session, rs.getString("role"));
                    int personId = rs.getInt("person_id");
                    session.save(new RoleAssociation(project.getId(), personId, role.getId()));
                    // Person should have permission to read/edit their own profile
                    session.save(new Permission("system.person", 0, personId, "read%"));
                    session.save(new Permission("system.person", personId, personId, "edit%"));
                }
            }
        } catch (SQLException e) {
            throw e;
        } finally {
View Full Code Here

                                        AbstractEditorForm form,
                                        ObjectRepository objectRepository) throws Exception
    {
        Session session = ThreadSession.get();
        DomainObject person = super.createObject(objectClass, request, form, objectRepository);
        session.save(new Permission("system.person",person.getId(),person.getId(),"edit%"));
        session.save(new Permission("system.person",0,person.getId(),"read%"));

        return person;
    }
View Full Code Here

    }

    private void addPermission(Session session, int personId, String resourceType, int resourceId, String permissionName)
            throws HibernateException {
        Permission permission = new Permission(resourceType, resourceId, personId, permissionName);
        session.save(permission);
    }
View Full Code Here

TOP

Related Classes of org.nxplanner.security.auth.Permission

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.