Removes a single project permission from user
6627
public void deleteProjectPermission(DbSession dbSession, int userId, String permission, long projectId) {
    mapper(dbSession).deleteProjectPermission(userId, permission, projectId);
  }
665593
def revoke_admin():
    """"""
    build = g.build
    form = forms.RemoveAdminForm()
    if form.validate_on_submit():
        user = models.User.query.get(form.user_id.data)
        if not user:
            logging.debug('User being revoked admin access does not exist.'
                          'id=%r, build_id=%r', form.user_id.data, build.id)
            abort(400)

        if user == current_user:
            logging.debug('User trying to remove themself as admin. '
                          'id=%r, build_id=%r', user.id, build.id)
            abort(400)

        db.session.add(build)
        db.session.add(user)
        db.session.refresh(build, lockmode='update')
        db.session.refresh(user, lockmode='update')

        user_is_owner = build.owners.filter_by(id=user.id)
        if not user_is_owner:
            logging.debug('User being revoked admin access is not owner. '
                          'id=%r, build_id=%r.', user.id, build.id)
            abort(400)

        build.owners.remove(user)
        save_admin_log(build, revoked_admin=True, message=user.email_address)

        db.session.commit()

        operations.UserOps(user.get_id()).evict()

    return redirect(url_for('manage_admins', build_id=build.id))
626276
def destroy(
            self, request, pk=None, parent_lookup_seedteam=None,
            parent_lookup_seedteam__organization=None):
        ''''''
        user = self.get_object()
        team = self.check_team_permissions(
            request, parent_lookup_seedteam,
            parent_lookup_seedteam__organization)
        team.users.remove(user)
        return Response(status=status.HTTP_204_NO_CONTENT)
1317054
def del_permission(self, name):
        
        perm = self.find_permission(name)
        if perm:
            try:
                self.get_session.delete(perm)
                self.get_session.commit()
            except Exception as e:
                log.error(c.LOGMSG_ERR_SEC_DEL_PERMISSION.format(str(e)))
                self.get_session.rollback()
1091679
def delete(self):
        
        args = {'ids': [self.id]}
        _perform_command(self.owner, 'project_delete', args)
        del self.owner.projects[self.id]
590976
def unshare_project(project_id, usernames,**kwargs):
    

    user_id = kwargs.get('user_id')
    proj_i = _get_project(project_id)
    proj_i.check_share_permission(user_id)

    for username in usernames:
        user_i = _get_user(username)
        #Set the owner ship on the network itself
        proj_i.unset_owner(user_i.id, write=write, share=share)
    db.DBSession.flush()
105755
def revoke_group_permission(
        self, group_name, source_group_name, source_group_owner_id):
        
        d = self.revoke_security_group(
            group_name,
            source_group_name=source_group_name,
            source_group_owner_id=source_group_owner_id)
        return d
816389
def remove():
    
    if exists(env.venv_path):
        run("rm -rf %s" % env.venv_path)
    if exists(env.proj_path):
        run("rm -rf %s" % env.proj_path)
    for template in get_templates().values():
        remote_path = template["remote_path"]
        if exists(remote_path):
            sudo("rm %s" % remote_path)
    if exists(env.repo_path):
        run("rm -rf %s" % env.repo_path)
    sudo("supervisorctl update")
    psql("DROP DATABASE IF EXISTS %s;" % env.proj_name)
    psql("DROP USER IF EXISTS %s;" % env.proj_name)
873795
def clear(self, username, project):
        """"""
        method = 'DELETE'
        url = ('/project/{username}/{project}/build-cache?'
               'circle-token={token}'.format(username=username,
                                             project=project,
                                             token=self.client.api_token))
        json_data = self.client.request(method, url)
        return json_data
1085755
def remove_permission(self, file_id, permission_id):
        
        url = '{0}/{1}/permissions/{2}'.format(
            DRIVE_FILES_API_V2_URL,
            file_id,
            permission_id
        )

        self.request('delete', url)
845264
def remove_manager(self, manager):
        
        select_action = 'remove_manager'

        self._update_scope_project_team(select_action=select_action, user=manager, user_type='manager')
1351427
def revoke_access(self):
        """"""
        reading = PERMISSIONS['user']['execute'] + PERMISSIONS['group']['execute'] + PERMISSIONS['other']['execute']
        os.chmod(self.file_path, reading)
1096581
def register_remove_user_command(self, remove_user_func):
        
        description = "Removes user permission to access a remote project."
        remove_user_parser = self.subparsers.add_parser('remove-user', description=description)
        add_project_name_or_id_arg(remove_user_parser, help_text_suffix="remove a user from")
        user_or_email = remove_user_parser.add_mutually_exclusive_group(required=True)
        add_user_arg(user_or_email)
        add_email_arg(user_or_email)
        remove_user_parser.set_defaults(func=remove_user_func)
770345
private void removeFromPermissionsCache(IAuthorizationPrincipal[] principals)
            throws AuthorizationException {
        for (int i = 0; i < principals.length; i++) {
            cacheRemove(principals[i]);
        }
    }
318412
def delete_project(self, project):
        
        pid = project.pid

        # project deleted

        ds_project = self.get_project(pid)
        if ds_project is not None:
            self._delete_project(pid)

        return
667011
function revokePermission (commandOptions, { accountId, grantablePermissionName }) {
  return command(
    commandOptions,
    txHelper.addCommand(
      txHelper.emptyTransaction(),
      'revokePermission',
      {
        accountId,
        grantablePermissionName
      }
    )
  )
}
1053171
def user_remove(username,
                user=None,
                host=None,
                port=None,
                maintenance_db=None,
                password=None,
                runas=None):
    '''
    
    '''
    return _role_remove(username,
                        user=user,
                        host=host,
                        port=port,
                        maintenance_db=maintenance_db,
                        password=password,
                        runas=runas)