Adds {@link Permission}s for the specified {@code member} to the specified {@code repoName}
in the specified {@code projectName}.
514187
public CompletableFuture<Revision> addPerUserPermission(Author author, String projectName,
                                                            String repoName, User member,
                                                            Collection<Permission> permission) {
        requireNonNull(author, "author");
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");
        requireNonNull(member, "member");
        requireNonNull(permission, "permission");

        return getProject(projectName).thenCompose(project -> {
            ensureProjectMember(project, member);
            return addPermissionAtPointer(author, projectName,
                                          perUserPermissionPointer(repoName, member.id()), permission,
                                          "Add permission of '" + member.id() +
                                          "' as '" + permission + "' to the project " + projectName);
        });
    }
141799
public void addPermissions(String identity, String[] perm) throws RepositoryException
   {
      for (String p : perm)
      {
         accessList.add(new AccessControlEntry(identity, p));
      }
   }
988026
public int deleteProjectPermissionOfAnyUser(DbSession dbSession, long projectId, String permission) {
    return mapper(dbSession).deleteProjectPermissionOfAnyUser(projectId, permission);
  }
966686
public CompletableFuture<Revision> removePerUserPermission(Author author, String projectName,
                                                               String repoName, User member) {
        requireNonNull(author, "author");
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");
        requireNonNull(member, "member");

        final String memberId = member.id();
        return removePermissionAtPointer(author, projectName,
                                         perUserPermissionPointer(repoName, memberId),
                                         "Remove permission of the '" + memberId +
                                         "' from the project " + projectName);
    }
990241
@Override
    public void addPermission(final String permission) {
        CommonHelper.assertNotBlank("permission", permission);
        this.permissions.add(permission);
    }
342953
public CompletableFuture<Revision> removePerTokenPermission(Author author, String projectName,
                                                                String repoName, String appId) {
        requireNonNull(author, "author");
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");
        requireNonNull(appId, "appId");

        return removePermissionAtPointer(author, projectName,
                                         perTokenPermissionPointer(repoName, appId),
                                         "Remove permission of the token '" + appId +
                                         "' from the project " + projectName);
    }
411206
@Delete("/metadata/{projectName}/repos/{repoName}/perm/tokens/{appId}")
    public CompletableFuture<Revision> removeSpecificTokenPermission(@Param("projectName") String projectName,
                                                                     @Param("repoName") String repoName,
                                                                     @Param("appId") String appId,
                                                                     Author author) {
        return mds.findTokenByAppId(appId)
                  .thenCompose(token -> mds.removePerTokenPermission(author,
                                                                     projectName, repoName, appId));
    }
468449
public void setUserPermission(String userName, List<Permission> permissions){
        getServiceDirectoryClient().setACL(new ACL(AuthScheme.DIRECTORY, userName, PermissionUtil.permissionList2Id(permissions)));
    }
785056
protected void requestPermission(String[] permissions, int code) {
        if (Build.VERSION.SDK_INT >= 23) {
            List<String> deniedPermissions = getDeniedPermissions(this, permissions);
            if (deniedPermissions.isEmpty()) {
                onPermissionGranted(code);
            } else {
                permissions = new String[deniedPermissions.size()];
                deniedPermissions.toArray(permissions);
                ActivityCompat.requestPermissions(this, permissions, code);
            }
        } else {
            onPermissionGranted(code);
        }
    }
451443
public Set<String> selectProjectPermissions(DbSession dbSession, String projectUuid, long userId) {
    return mapper(dbSession).selectProjectPermissions(projectUuid, userId);
  }
957676
public void addMemberHeader(ExecutableElement member, Content methodsContentTree) {
        methodsContentTree.addContent(getHead(member));
        methodsContentTree.addContent(getSignature(member));
    }
744008
private static void ensureProjectMember(ProjectMetadata project, User user) {
        requireNonNull(project, "project");
        requireNonNull(user, "user");

        checkArgument(project.members().values().stream().anyMatch(member -> member.login().equals(user.id())),
                      user.id() + " is not a member of the project " + project.name());
    }
1345332
public void setPermission(String src, FsPermission permission
  ) throws IOException {
    INode[] inodes = null;
    writeLock();
    try {
      if (isInSafeMode()) {
        throw new SafeModeException("Cannot set permission for " + src, safeMode);
      }
      inodes = dir.getExistingPathINodes(src);
      if (isPermissionCheckingEnabled(inodes)) {
        checkOwner(src, inodes);
      }
      dir.setPermission(src, permission);
    } finally {
      writeUnlock();
    }
    getEditLog().logSync(false);
    if (auditLog.isInfoEnabled()) {
      logAuditEvent(getCurrentUGI(),
        Server.getRemoteIp(),
        "setPermission", src, null, getLastINode(inodes));
    }
  }
590160
public void setAcePermissionsDenied(String acePermissionsDenied) {

        try {
            m_acePermissionsDenied = Integer.parseInt(acePermissionsDenied);
        } catch (Throwable e) {
            m_throwable = e;
        }
    }
863794
@Override
    public void addPermissions(IPermission[] permissions) throws AuthorizationException {
        if (permissions.length > 0) {
            getPermissionStore().add(permissions);
            if (this.cachePermissions) {
                removeFromPermissionsCache(permissions);
            }
        }
    }
618585
@RequestMapping(value = "projects/{projectId}/{type}/{id}", method = RequestMethod.PUT)
    public Ack saveProjectPermission(@PathVariable ID projectId, @PathVariable PermissionTargetType type, @PathVariable int id, @RequestBody PermissionInput input) {
        return accountService.saveProjectPermission(projectId, type, id, input);
    }
1172298
def addprojectmember(self, project_id, user_id, access_level):
        
        # if isinstance(access_level, basestring):
        if access_level.lower() == 'master':
            access_level = 40
        elif access_level.lower() == 'developer':
            access_level = 30
        elif access_level.lower() == 'reporter':
            access_level = 20
        else:
            access_level = 10

        data = {'id': project_id, 'user_id': user_id, 'access_level': access_level}

        request = requests.post(
            '{0}/{1}/members'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return True
        else:
            return False