Examples of checkAccess()


Examples of com.cloud.acl.DomainChecker.checkAccess()

    @Bean
    public DomainChecker domainChecker() {
        DomainChecker mock = Mockito.mock(DomainChecker.class);
        try {
            Mockito.when(mock.checkAccess(Matchers.any(Account.class), Matchers.any(DataCenter.class))).thenReturn(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mock;
    }
View Full Code Here

Examples of com.threerings.crowd.data.BodyObject.checkAccess()

    // from interface SpotProvider
    public void clusterSpeak (ClientObject caller, String message, byte mode)
    {
        // ensure the caller has normal chat access
        BodyObject source = _locator.forClient(caller);
        String errmsg = source.checkAccess(ChatCodes.CHAT_ACCESS, null);
        if (errmsg != null) {
            SpeakUtil.sendFeedback(source, MessageManager.GLOBAL_BUNDLE, errmsg);
        } else {
            sendClusterChatMessage(ScenePlace.getSceneId(source), source.getOid(),
                                   source.getVisibleName(), null, message, mode);
View Full Code Here

Examples of ecks.services.SrvAuth.checkAccess()

        if (args.length != 2) {
            Generic.curProtocol.outPRVMSG(who, replyto, "\u0002Usage:\u0002 changepass <old> <new>");
            return;
        }

        if (temp.checkAccess(uTemp).ordinal() >= CommandDesc.access_levels.A_HELPER.ordinal())  // we're a helper
        {
            // changepass username newpassword
            if (temp.getUsers().containsKey(args[0])) {
                temp.getUsers().get(args[0]).cngpass(args[1]);
                Generic.curProtocol.outPRVMSG(who, replyto, "Password Changed!");
View Full Code Here

Examples of frontend.alphaspawn.tools.command.Command.checkAccess()

      // Display list of commands
      for ( Iterator iter = cmdList.iterator() ; iter.hasNext() ; ) {
        Command cmd = (Command)iter.next();

        // Checks if the player has the right to see the command
        if ( cmd.checkAccess( playerName ) ) {
          String cmdName = cmd.getName().trim();
          if ( cmdName.length() > longestCmd ) { longestCmd = cmdName.length(); }

          // Memorize the command name
          cmdDisplay.put( cmdName, cmd );         
View Full Code Here

Examples of gnu.testlet.TestSecurityManager.checkAccess()

    sm.checkAccess(thread);
    sm.checkAllChecked();

    sm.prepareChecks(new Permission[] {
      new RuntimePermission("modifyThreadGroup")});
    sm.checkAccess(group);
    sm.checkAllChecked();
  }
}
View Full Code Here

Examples of gnu.testlet.TestSecurityManager.checkAccess()

    // Check we're checking
    TestSecurityManager sm = new TestSecurityManager(harness);

    sm.prepareChecks(new Permission[] {
      new RuntimePermission("modifyThread")});
    sm.checkAccess(thread);
    sm.checkAllChecked();

    sm.prepareChecks(new Permission[] {
      new RuntimePermission("modifyThreadGroup")});
    sm.checkAccess(group);
View Full Code Here

Examples of java.util.logging.LogManager.checkAccess()

    public void checkAccess() throws SecurityException {
        LogManager logManager = getContextualLogManager();
        if (logManager == null) {
            super.checkAccess();
        } else {
            logManager.checkAccess();
        }
    }

    @Override
    public Logger getLogger(String name) {
View Full Code Here

Examples of org.apache.hadoop.mapreduce.v2.app.job.Job.checkAccess()

    Job job = mock(Job.class);
    Task task = mock(Task.class);
    when(job.getTask(any(TaskId.class))).thenReturn(task);
    JobId jobID = MRApps.toJobID("job_01_01");
    when(ctx.getJob(jobID)).thenReturn(job);
    when(job.checkAccess(any(UserGroupInformation.class), any(JobACL.class)))
            .thenReturn(true);

    controller.job();
    assertEquals(HsJobPage.class, controller.getClazz());
    controller.jobCounters();
View Full Code Here

Examples of org.apache.hadoop.mapreduce.v2.app.job.Job.checkAccess()

    UserGroupInformation viewOnlyUser =
        UserGroupInformation.createUserForTesting(
            "viewonlyuser", new String[] {});
    Assert.assertTrue("viewonlyuser cannot view job",
        job.checkAccess(viewOnlyUser, JobACL.VIEW_JOB));
    Assert.assertFalse("viewonlyuser can modify job",
        job.checkAccess(viewOnlyUser, JobACL.MODIFY_JOB));
    MRClientProtocol client = viewOnlyUser.doAs(
        new PrivilegedExceptionAction<MRClientProtocol>() {
          @Override
View Full Code Here

Examples of org.apache.hadoop.mapreduce.v2.app.job.Job.checkAccess()

        UserGroupInformation.createUserForTesting(
            "viewonlyuser", new String[] {});
    Assert.assertTrue("viewonlyuser cannot view job",
        job.checkAccess(viewOnlyUser, JobACL.VIEW_JOB));
    Assert.assertFalse("viewonlyuser can modify job",
        job.checkAccess(viewOnlyUser, JobACL.MODIFY_JOB));
    MRClientProtocol client = viewOnlyUser.doAs(
        new PrivilegedExceptionAction<MRClientProtocol>() {
          @Override
          public MRClientProtocol run() throws Exception {
            YarnRPC rpc = YarnRPC.create(conf);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.