Class HibernateGroupDAO

    • Method Detail

      • getMenuDAO

        public MenuDAO getMenuDAO()
      • setMenuDAO

        public void setMenuDAO​(MenuDAO menuDAO)
      • delete

        public boolean delete​(long groupId,
                              int code)
        Description copied from interface: PersistentObjectDAO
        This method deletes an entity and you can give a deletion code
        Specified by:
        delete in interface PersistentObjectDAO<Group>
        Overrides:
        delete in class HibernatePersistentObjectDAO<Group>
        Parameters:
        groupId - ID of the entity which should be deleted
        code - Deletion code
        Returns:
        if the record has been successfully deleted
      • exists

        public boolean exists​(String groupname,
                              long tenantId)
      • findAllGroupNames

        public Collection<String> findAllGroupNames​(long tenantId)
        Description copied from interface: GroupDAO
        This method selects all group names
        Specified by:
        findAllGroupNames in interface GroupDAO
        Parameters:
        tenantId - identifier of the tenant
        Returns:
        collection of all the group names
      • findByName

        public Group findByName​(String name,
                                long tenantId)
        Description copied from interface: GroupDAO
        Finds a group by name.
        Specified by:
        findByName in interface GroupDAO
        Parameters:
        name - name of wanted group.
        tenantId - ID of the owning tenant
        Returns:
        Wanted group or null.
      • insert

        public boolean insert​(Group group,
                              long parentGroupId)
        Description copied from interface: GroupDAO
        This method persists a new group object. All permissions and extended attributes of the parent group will be replicated.
        Specified by:
        insert in interface GroupDAO
        Parameters:
        group - Group which should be stored in a database.
        parentGroupId - ID of the group this group inherits ACLs from
        Returns:
        True if successful stored in a database.
      • inheritACLs

        public void inheritACLs​(Group group,
                                long parentGroupId)
        Description copied from interface: GroupDAO
        This method replicates all ACLs of the parent group to another group.

        Attention: The group(groupId) ACLs will be discarded.

        Specified by:
        inheritACLs in interface GroupDAO
        Parameters:
        group - The group to be altered.
        parentGroupId - The group whose ACLs will be inherited.
      • findByLikeName

        public Collection<Group> findByLikeName​(String name,
                                                long tenantId)
        Description copied from interface: GroupDAO
        This method finds a Group by name.
        Specified by:
        findByLikeName in interface GroupDAO
        Parameters:
        name - The name of wanted Group.
        tenantId - ID of the owning tenant
        Returns:
        Collection of selected groups.
      • count

        public int count()
        Description copied from interface: GroupDAO
        Counts the total number of groups
        Specified by:
        count in interface GroupDAO
        Returns:
        total number of groups
      • fixGuestPermissions

        public void fixGuestPermissions​(Group group)
        If the user is guest, we remove not admitted permissions
        Specified by:
        fixGuestPermissions in interface GroupDAO