Package org.apache.storm.daemon.logviewer.utils

# Class ResourceAuthorizer

java.lang.Object
org.apache.storm.daemon.logviewer.utils.ResourceAuthorizer

public class ResourceAuthorizer extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ResourceAuthorizer.LogUserGroupWhitelist`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceAuthorizer(Map<String,Object> stormConf)`
  Constuctor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ResourceAuthorizer.LogUserGroupWhitelist`
  `getLogUserGroupWhitelist(String fileName)`
  Get the whitelist of users and groups for given file.
  `boolean`
  `isAuthorizedLogUser(String user, String fileName)`
  Checks whether user is authorized to access file.
  `boolean`
  `isUserAllowedToAccessFile(String user, String fileName)`
  Checks whether user is allowed to access a Logviewer file via UI.

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

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

- ## Constructor Details

  - ### ResourceAuthorizer

    public ResourceAuthorizer(Map<String,Object> stormConf)
    Constuctor.
    Parameters:
      `stormConf` - storm configuration

- ## Method Details

  - ### isUserAllowedToAccessFile

    public boolean isUserAllowedToAccessFile(String user, String fileName)
    Checks whether user is allowed to access a Logviewer file via UI. Always true when the Logviewer filter is not configured.
    Parameters:
      `fileName` - file name to access. The file name must not contain upward path traversal sequences (e.g. "../").
      `user` - username

  - ### isAuthorizedLogUser

    public boolean isAuthorizedLogUser(String user, String fileName)
    Checks whether user is authorized to access file. Checks regardless of UI filter.
    Parameters:
      `user` - username
      `fileName` - file name to access. The file name must not contain upward path traversal sequences (e.g. "../").

  - ### getLogUserGroupWhitelist

    public ResourceAuthorizer.LogUserGroupWhitelist getLogUserGroupWhitelist(String fileName)
    Get the whitelist of users and groups for given file.
    Parameters:
      `fileName` - file name to get the whitelist