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
    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).
    `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` | `isPackageExcluded(Package targetPackage, Package memberPackage)`
    `void` | `restore(Map context, Object target, Member member, String propertyName, Object state)`
    `void` | `setAcceptProperties(Set<Pattern> acceptedProperties)`
    `void` | `setDisallowProxyMemberAccess(boolean disallowProxyMemberAccess)`
    `void` | `setExcludedClasses(Set<Class<?>> excludedClasses)`
    `void` | `setExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)`
    `void` | `setExcludedPackageNames(Set<String> excludedPackageNames)`
    `void` | `setExcludeProperties(Set<Pattern> excludeProperties)`
    `Object` | `setup(Map context, Object target, Member member, String propertyName)`

    - ### 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(Package targetPackage,
                                              Package memberPackage)

    - #### isClassExcluded

          protected boolean isClassExcluded(Class<?> clazz)

    - #### isAcceptableProperty

          protected boolean isAcceptableProperty(String name)

    - #### isAccepted

          protected boolean isAccepted(String paramName)

    - #### isExcluded

          protected boolean isExcluded(String paramName)

    - #### setExcludeProperties

          public void setExcludeProperties(Set<Pattern> excludeProperties)

    - #### setAcceptProperties

          public void setAcceptProperties(Set<Pattern> acceptedProperties)

    - #### setExcludedClasses

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

    - #### setExcludedPackageNamePatterns

          public void setExcludedPackageNamePatterns(Set<Pattern> excludedPackageNamePatterns)

    - #### setExcludedPackageNames

          public void setExcludedPackageNames(Set<String> excludedPackageNames)

    - #### setDisallowProxyMemberAccess

          public void setDisallowProxyMemberAccess(boolean disallowProxyMemberAccess)

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