java.lang.SecurityManager.checkPermission()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中java.lang.SecurityManager.checkPermission()方法的一些代码示例,展示了SecurityManager.checkPermission()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SecurityManager.checkPermission()方法的具体详情如下:
包路径:java.lang.SecurityManager
类名称:SecurityManager
方法名:checkPermission

SecurityManager.checkPermission介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the user has permission 'ConverterManager.alterInstantConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterInstantConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterInstantConverters"));
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the user has permission 'ConverterManager.alterPartialConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterPartialConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterPartialConverters"));
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the provider may be changed using permission 'CurrentTime.setProvider'.
 * 
 * @throws SecurityException if the provider may not be changed
 */
private static void checkPermission() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("CurrentTime.setProvider"));
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the user has permission 'ConverterManager.alterIntervalConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterIntervalConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterIntervalConverters"));
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the user has permission 'ConverterManager.alterPeriodConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterPeriodConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterPeriodConverters"));
  }
}

代码示例来源:origin: prestodb/presto

/**
 * Checks whether the user has permission 'ConverterManager.alterDurationConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterDurationConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterDurationConverters"));
  }
}

代码示例来源:origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public Dispatcher initialize() {
  SecurityManager securityManager = System.getSecurityManager();
  if (securityManager != null) {
    try {
      securityManager.checkPermission(SUPPRESS_ACCESS_CHECKS);
    } catch (Exception exception) {
      return new Dispatcher.Unavailable(exception.getMessage());
    }
  }
  return this;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterInstantConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterInstantConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterInstantConverters"));
  }
}

代码示例来源:origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public Dispatcher initialize() {
  SecurityManager securityManager = System.getSecurityManager();
  if (securityManager != null) {
    try {
      securityManager.checkPermission(SUPPRESS_ACCESS_CHECKS);
    } catch (Exception exception) {
      return new Unavailable(exception.getMessage());
    }
  }
  return this;
}

代码示例来源:origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public Dispatcher initialize() {
  SecurityManager securityManager = System.getSecurityManager();
  if (securityManager != null) {
    try {
      securityManager.checkPermission(SUPPRESS_ACCESS_CHECKS);
    } catch (Exception exception) {
      return new Dispatcher.Unavailable(exception.getMessage());
    }
  }
  return this;
}

代码示例来源:origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public Dispatcher initialize() {
  SecurityManager securityManager = System.getSecurityManager();
  if (securityManager != null) {
    try {
      securityManager.checkPermission(SUPPRESS_ACCESS_CHECKS);
    } catch (Exception exception) {
      return new Dispatcher.Unavailable(exception.getMessage());
    }
  }
  return this;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the provider may be changed using permission 'CurrentTime.setProvider'.
 * 
 * @throws SecurityException if the provider may not be changed
 */
private static void checkPermission() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("CurrentTime.setProvider"));
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterIntervalConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterIntervalConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterIntervalConverters"));
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterPartialConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterPartialConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterPartialConverters"));
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterDurationConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterDurationConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterDurationConverters"));
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterPeriodConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterPeriodConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterPeriodConverters"));
  }
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Checks whether the provider may be changed using permission 'CurrentTime.setProvider'.
 * 
 * @throws SecurityException if the provider may not be changed
 */
private static void checkPermission() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("CurrentTime.setProvider"));
  }
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Checks whether the user has permission 'ConverterManager.alterPeriodConverters'.
 * 
 * @throws SecurityException if the user does not have the permission
 */
private void checkAlterPeriodConverters() throws SecurityException {
  SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(new JodaTimePermission("ConverterManager.alterPeriodConverters"));
  }
}

代码示例来源:origin: neo4j/neo4j

@Override
public void checkPermission( Permission perm, Object context )
{
  if ( managerExists() )
  {
    securityManager.checkPermission( perm, context );
  }
  else
  {
    super.checkPermission( perm, context );
  }
}

代码示例来源:origin: neo4j/neo4j

@Override
public void checkPermission( Permission perm )
{
  // if original security manager exists delegate permission check to it
  // otherwise silently allow everything
  if ( managerExists() )
  {
    securityManager.checkPermission( perm );
  }
}

相关文章