Class CNAuthentication

    • Method Detail

      • isMember

        public boolean isMember​(String group)
        Parameters:
        group - name of a CN group.
        Returns:
        true if the user is a member of the given group.
      • isCNAuthed

        public boolean isCNAuthed()
        Determine whether we have authenticated to CTF in the browser.
        Returns:
        true if authenticated
      • setCNAuthed

        public void setCNAuthed​(boolean cnauthed)
        Set whether we have authenticated to CTF in the browser.
        Parameters:
        cnauthed - true if current session is CTF authenticated in browser
      • isSuperUser

        public boolean isSuperUser()
        Determines if the authenticated user is a super user. This is currently from data that's calculated once (on login). If this ever turns out to be insufficient, we could change this method to get the data on the fly.
      • isMemberOfAny

        public boolean isMemberOfAny​(Collection<String> groups)
        Determines if the authenticated user belongs to any of the groups. This is currently from data that's calculated once (on login). If this ever turns out to be insufficient, we could change this method to get the data on the fly.
        Parameters:
        groups - collection of groups
        Returns:
        true if the user is a member of any of the groups.
      • isProjectAdmin

        public boolean isProjectAdmin​(CTFProject p)
        Determines if the authenticated user is a project admin.
        Returns:
        true if the user is a project admin.
      • getSessionId

        public String getSessionId()
      • getUserProjectPermSet

        public Set<Permission> getUserProjectPermSet​(String username,
                                                     String projectId)
        Get a set of all permission that a user has for a given project.
        Parameters:
        username - user name
        projectId - project id
        Returns:
        set of permissions