Class Jsr250MethodSecurityMetadataSource

    • Constructor Detail

      • Jsr250MethodSecurityMetadataSource

        public Jsr250MethodSecurityMetadataSource()
    • Method Detail

      • setDefaultRolePrefix

        public void setDefaultRolePrefix​(java.lang.String defaultRolePrefix)

        Sets the default prefix to be added to RolesAllowed. For example, if @RolesAllowed("ADMIN") or @RolesAllowed("ADMIN") is used, then the role ROLE_ADMIN will be used when the defaultRolePrefix is "ROLE_" (default).

        If null or empty, then no default role prefix is used.

        defaultRolePrefix - the default prefix to add to roles. Default "ROLE_".
      • findAttributes

        protected java.util.Collection<ConfigAttribute> findAttributes​(java.lang.reflect.Method method,
                                                                       java.lang.Class<?> targetClass)
        Description copied from class: AbstractFallbackMethodSecurityMetadataSource
        Obtains the security metadata applicable to the specified method invocation.

        Note that the Method.getDeclaringClass() may not equal the targetClass. Both parameters are provided to assist subclasses which may wish to provide advanced capabilities related to method metadata being "registered" against a method even if the target class does not declare the method (i.e. the subclass may only inherit the method).

        Specified by:
        findAttributes in class AbstractFallbackMethodSecurityMetadataSource
        method - the method for the current invocation (never null)
        targetClass - the target class for the invocation (may be null)
        the security metadata (or null if no metadata applies)
      • getAllConfigAttributes

        public java.util.Collection<ConfigAttribute> getAllConfigAttributes()
        Description copied from interface: SecurityMetadataSource
        If available, returns all of the ConfigAttributes defined by the implementing class.

        This is used by the AbstractSecurityInterceptor to perform startup time validation of each ConfigAttribute configured against it.

        the ConfigAttributes or null if unsupported