com.opensymphony.xwork2.ognl

## Class SecurityMemberAccess

- java.lang.Object
- - com.opensymphony.xwork2.ognl.SecurityMemberAccess

- All Implemented Interfaces:
    ognl.MemberAccess

      public class SecurityMemberAccess
      extends Object
      implements ognl.MemberAccess

  Allows access decisions to be made on the basis of whether a member is static or not. Also blocks or allows access to properties.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SecurityMemberAccess(boolean allowStaticFieldAccess)` SecurityMemberAccess - access decisions based on whether member is static (or not) - block or allow access to properties (configurable-after-construction)

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `checkEnumAccess(Object target, Member member)`
    `protected boolean` | `checkPublicMemberAccess(int memberModifiers)` Check access for public members (via modifiers)
    `protected boolean` | `checkStaticFieldAccess(Member member, int memberModifiers)` Check access for static field (via modifiers).
    `protected boolean` | `checkStaticMethodAccess(Member member, int memberModifiers)` Check access for static method (via modifiers).
    `void` | `disallowProxyMemberAccess(boolean disallowProxyMemberAccess)`
    `protected boolean` | `isAcceptableProperty(String name)`
    `protected boolean` | `isAccepted(String paramName)`
    `boolean` | `isAccessible(Map context, Object target, Member member, String propertyName)`
    `protected boolean` | `isClassExcluded(Class<?> clazz)`
    `protected boolean` | `isExcluded(String paramName)`
    `protected boolean` | `isExcludedPackageExempt(Class<?> clazz)`
    `protected boolean` | `isExcludedPackageNamePatterns(Class<?> clazz)`
    `protected boolean` | `isExcludedPackageNames(Class<?> clazz)`
    `protected boolean` | `isPackageExcluded(Class<?> targetClass, Class<?> memberClass)`
    `void` | `restore(Map context, Object target, Member member, String propertyName, Object state)`
    `void` | `setAcceptProperties(Set<Pattern> acceptedProperties)` Deprecated. please use `useAcceptProperties(Set)`
    `void` | `setDisallowProxyMemberAccess(boolean disallowProxyMemberAccess)` Deprecated. please use `disallowProxyMemberAccess(boolean)`
    `void` | `setExcludedClasses(Set<Class<?>> excludedClasses)` Deprecated. please use `useExcludedClasses(Set)`
    `void` | `setExcludedPackageExemptClasses(Set<Class<?>> excludedPackageExemptClasses)` Deprecated. please use `useExcludedPackageExemptClasses(Set)`
    `void` | `setExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)` Deprecated. please use `useExcludedPackageNamePatterns(Set)`
    `void` | `setExcludedPackageNames(Set<String> excludedPackageNames)` Deprecated. please use `useExcludedPackageNames(Set)`
    `void` | `setExcludeProperties(Set<Pattern> excludeProperties)` Deprecated. please use `useExcludeProperties(Set)`
    `Object` | `setup(Map context, Object target, Member member, String propertyName)`
    `protected String` | `toPackageName(Class<?> clazz)`
    `void` | `useAcceptProperties(Set<Pattern> acceptedProperties)`
    `void` | `useExcludedClasses(Set<Class<?>> excludedClasses)`
    `void` | `useExcludedPackageExemptClasses(Set<Class<?>> excludedPackageExemptClasses)`
    `void` | `useExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)`
    `void` | `useExcludedPackageNames(Set<String> excludedPackageNames)`
    `void` | `useExcludeProperties(Set<Pattern> excludeProperties)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SecurityMemberAccess

          public SecurityMemberAccess(boolean allowStaticFieldAccess)

      SecurityMemberAccess - access decisions based on whether member is static (or not) - block or allow access to properties (configurable-after-construction)
      Parameters:
        `allowStaticFieldAccess` - if set to true static fields (constants) will be accessible

  - ### Method Detail

    - #### setup

          public Object setup(Map context,
                              Object target,
                              Member member,
                              String propertyName)

      Specified by:
        `setup` in interface `ognl.MemberAccess`

    - #### restore

          public void restore(Map context,
                              Object target,
                              Member member,
                              String propertyName,
                              Object state)

      Specified by:
        `restore` in interface `ognl.MemberAccess`

    - #### isAccessible

          public boolean isAccessible(Map context,
                                      Object target,
                                      Member member,
                                      String propertyName)

      Specified by:
        `isAccessible` in interface `ognl.MemberAccess`

    - #### checkStaticMethodAccess

          protected boolean checkStaticMethodAccess(Member member,
                                                    int memberModifiers)

      Check access for static method (via modifiers). Note: For non-static members, the result is always true.
      Parameters:
        `member` -
        `memberModifiers` -
      Returns:

    - #### checkStaticFieldAccess

          protected boolean checkStaticFieldAccess(Member member,
                                                   int memberModifiers)

      Check access for static field (via modifiers).

      Note: For non-static members, the result is always true.

      Parameters:
        `member` -
        `memberModifiers` -
      Returns:

    - #### checkPublicMemberAccess

          protected boolean checkPublicMemberAccess(int memberModifiers)

      Check access for public members (via modifiers)

      Returns true if-and-only-if the member is public.

      Parameters:
        `memberModifiers` -
      Returns:

    - #### checkEnumAccess

          protected boolean checkEnumAccess(Object target,
                                            Member member)

    - #### isPackageExcluded

          protected boolean isPackageExcluded(Class<?> targetClass,
                                              Class<?> memberClass)

    - #### toPackageName

          protected String toPackageName(Class<?> clazz)

    - #### isExcludedPackageNamePatterns

          protected boolean isExcludedPackageNamePatterns(Class<?> clazz)

    - #### isExcludedPackageNames

          protected boolean isExcludedPackageNames(Class<?> clazz)

    - #### isClassExcluded

          protected boolean isClassExcluded(Class<?> clazz)

    - #### isExcludedPackageExempt

          protected boolean isExcludedPackageExempt(Class<?> clazz)

    - #### isAcceptableProperty

          protected boolean isAcceptableProperty(String name)

    - #### isAccepted

          protected boolean isAccepted(String paramName)

    - #### isExcluded

          protected boolean isExcluded(String paramName)

    - #### setExcludeProperties

          @Deprecated
          public void setExcludeProperties(Set<Pattern> excludeProperties)

      Deprecated. please use `useExcludeProperties(Set)`

    - #### useExcludeProperties

          public void useExcludeProperties(Set<Pattern> excludeProperties)

    - #### setAcceptProperties

          @Deprecated
          public void setAcceptProperties(Set<Pattern> acceptedProperties)

      Deprecated. please use `useAcceptProperties(Set)`

    - #### useAcceptProperties

          public void useAcceptProperties(Set<Pattern> acceptedProperties)

    - #### setExcludedClasses

          @Deprecated
          public void setExcludedClasses(Set<Class<?>> excludedClasses)

      Deprecated. please use `useExcludedClasses(Set)`

    - #### useExcludedClasses

          public void useExcludedClasses(Set<Class<?>> excludedClasses)

    - #### setExcludedPackageNamePatterns

          @Deprecated
          public void setExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)

      Deprecated. please use `useExcludedPackageNamePatterns(Set)`

    - #### useExcludedPackageNamePatterns

          public void useExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)

    - #### setExcludedPackageNames

          @Deprecated
          public void setExcludedPackageNames(Set<String> excludedPackageNames)

      Deprecated. please use `useExcludedPackageNames(Set)`

    - #### useExcludedPackageNames

          public void useExcludedPackageNames(Set<String> excludedPackageNames)

    - #### setExcludedPackageExemptClasses

          @Deprecated
          public void setExcludedPackageExemptClasses(Set<Class<?>> excludedPackageExemptClasses)

      Deprecated. please use `useExcludedPackageExemptClasses(Set)`

    - #### useExcludedPackageExemptClasses

          public void useExcludedPackageExemptClasses(Set<Class<?>> excludedPackageExemptClasses)

    - #### setDisallowProxyMemberAccess

          @Deprecated
          public void setDisallowProxyMemberAccess(boolean disallowProxyMemberAccess)

      Deprecated. please use `disallowProxyMemberAccess(boolean)`

    - #### disallowProxyMemberAccess

          public void disallowProxyMemberAccess(boolean disallowProxyMemberAccess)

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.