Class ThreadLocalPermissionsCacheInternal


  • public class ThreadLocalPermissionsCacheInternal
    extends Object
    Wrapper around the ThreadLocalCache to deal with caching space permissions and application access.

    Note the publicly-exposed com.atlassian.confluence.security.ThreadLocalPermissionsCache (which has become de facto plugin API) calls here. We hide this one so that access to the mutator methods is confined to core: the public one's mutators are deprecated no-ops.

    Note for this (and all ThreadLocalCache uses) to work, ThreadLocalCache.init() must be called. Normally this is done by ThreadLocalCacheFilter. In integration tests you'll need to do it manually.
    See Also:
    com.atlassian.confluence.security.ThreadLocalPermissionsCache
    • Constructor Detail

      • ThreadLocalPermissionsCacheInternal

        public ThreadLocalPermissionsCacheInternal()
    • Method Detail

      • hasSpacePermission

        public static Boolean hasSpacePermission​(String permission,
                                                 Space space,
                                                 com.atlassian.user.User user)
      • cacheSpacePermission

        public static void cacheSpacePermission​(com.atlassian.user.User user,
                                                String permission,
                                                Space space,
                                                boolean hasPermission)
      • cacheCanUseConfluence

        @Deprecated
        public static void cacheCanUseConfluence​(com.atlassian.user.User user,
                                                 boolean canUse)
        Deprecated.
        since 5.9: only here to support legacy com.atlassian.confluence.security.ThreadLocalPermissionsCache#canUseConfluence(User).
      • getUserAccessStatus

        public static com.atlassian.fugue.Option<AccessStatus> getUserAccessStatus​(com.atlassian.user.User user)
      • cacheUserAccessStatus

        public static void cacheUserAccessStatus​(@Nullable com.atlassian.user.User user,
                                                 @NonNull AccessStatus accessStatus)
      • flushUserAccessStatusForUser

        public static void flushUserAccessStatusForUser​(@Nullable com.atlassian.user.User user)
      • flushUserAccessStatusForAllUsers

        public static void flushUserAccessStatusForAllUsers()
      • flush

        public static void flush()
      • hasPermissionExemption

        public static Boolean hasPermissionExemption​(com.atlassian.user.User user)
      • cachePermissionExemption

        public static void cachePermissionExemption​(com.atlassian.user.User user,
                                                    boolean exempt)
      • hasTemporaryPermissionExemption

        public static boolean hasTemporaryPermissionExemption()
      • enableTemporaryPermissionExemption

        public static void enableTemporaryPermissionExemption()
      • disableTemporaryPermissionExemption

        public static void disableTemporaryPermissionExemption()