Interface AuthorizationContainer

    • Field Detail

      • LOGGER

        static final Logger LOGGER
    • Method Detail

      • getGrantedPermissions

        @Deprecated
        default Map<Permission,​Set<String>> getGrantedPermissions()
        Deprecated.
        Since 3.0, use {getGrantedPermissionEntries()} instead.
        Returns all the (Permission, sid) tuples where permissions are granted to either groups or users. This does NOT include permissions granted specifically to users or groups (added in 3.0).
        Returns:
        read-only. never null.
      • getGrantedPermissionEntries

        Map<Permission,​Set<PermissionEntry>> getGrantedPermissionEntries()
        Returns a live modifiable map of permissions. This return value needs to be treated as unmodifiable from shortly after object construction (even though it isn't for practical reasons).
        Since:
        3.0
      • recordGroup

        void recordGroup​(String sid)
        Internal only: Record use of a (possible) group sid to be later returned in getGroups().
      • add

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        default void add​(String shortForm)
        Works like add(Permission, PermissionEntry) but takes both parameters from a single string of the form PERMISSION_ID:sid (legacy format, implicit 'EITHER' type) or type:PERMISSION_ID:sid (new since 3.0).

        The supported formats for PERMISSION_ID are:

        • Internal ID: hudson.model.Hudson.ADMINISTER
        • UI short form: Overall/Administer
        See Also:
        Permission.fromId(String), PermissionFinder
      • parsePermission

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        static Permission parsePermission​(String permission)
      • getEditingPermission

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        Permission getEditingPermission()
      • getAllSIDs

        @Deprecated
        default List<String> getAllSIDs()
        Deprecated.
        Since 3.0, use {getAllPermissionEntries()} instead.
        Returns SIDs configured in this matrix with 'either' (legacy pre-3.0) type, minus "anonymous". This does NOT include permissions granted specifically to users or groups (new in 3.0).
        Returns:
        Always non-null.
      • hasPermission

        default boolean hasPermission​(String sid,
                                      Permission p,
                                      boolean principal)
        Checks if the given SID has the given permission.
      • hasExplicitPermission

        default boolean hasExplicitPermission​(PermissionEntry entry,
                                              Permission p)
        Return true if and only if the exact permission entry is explicitly granted the specified permission, ignoring compatible types (e.g. passing USER will not match an EITHER entry) and implications.
        Parameters:
        entry - the entry to check for
        p - the permission to check for
        Returns:
        true if and only if the exact entry matches
        Since:
        3.0