Remove permissions from the user with user_full_name or email on the remote project with project_name.
        :param args Namespace arguments parsed from the command line
485096
def run(self, args):
        
        email = args.email                # email of person to remove permissions from (None if username specified)
        username = args.username          # username of person to remove permissions from (None if email is specified)
        project = self.fetch_project(args, must_exist=True, include_children=False)
        user = self.remote_store.lookup_or_register_user_by_email_or_username(email, username)
        self.remote_store.revoke_user_project_permission(project, user)
        print(u'Removed permissions from user {} for project {}.'.format(user.full_name, project.name))
769023
def delete_user_role(self, user, role):
        
        self.project_service.set_auth(self._token_project)
        self.project_service.delete_user_role(user, role)
648254
def list_user_permissions(self, name):
        
        return self._api_get('/api/users/{0}/permissions'.format(
            urllib.parse.quote_plus(name)
        ))
1015531
def remove_from_user(self, name, *args):
        
        user = self.get_user(name=name)
        attrs_ = user['user']
        for a in args:
            del attrs_[a]
876626
def remove_permission(self, label, callback=None):
        
        return self.connection.remove_permission(self, label, callback=callback)
252702
def get_project_by_name(project_name,**kwargs):
    
    user_id = kwargs.get('user_id')

    projects_i = db.DBSession.query(Project).join(ProjectOwner).filter(
                                                    Project.name==project_name,
                                                    ProjectOwner.user_id==user_id).order_by('name').all()

    ret_projects = []
    for project_i in projects_i:
        try:
            project_i.check_read_permission(user_id)
            ret_projects.append(project_i)
        except:
            log.info("Can't return project %s. User %s does not have permission to read it.", project_i.id, user_id)

    return ret_projects
674090
def delete_permission(self, vname, username):
        
        vname = quote(vname, '')
        path = Client.urls['vhost_permissions'] % (vname, username)
        return self._call(path, 'DELETE')
184039
def delete(self, project, params={}, **options): 
        
        path = "/projects/%s" % (project)
        return self.client.delete(path, params, **options)
490802
def delete_user(self, username):
        
        path = Client.urls['users_by_name'] % username
        return self._call(path, 'DELETE')
474418
def _add_auth_role_arg(arg_parser, default_permissions):
    
    help_text = "Specifies which project permissions to give to the user. Example: 'project_admin'. "
    help_text += "See command list_auth_roles for AuthRole values."
    arg_parser.add_argument("--auth-role",
                            metavar='AuthRole',
                            type=to_unicode,
                            dest='auth_role',
                            help=help_text,
                            default=default_permissions)
1054386
def list_user_permissions(name, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'list_user_permissions', name, '-q'],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)

    return _output_to_dict(res)
435653
def pruned(name, user=None, env=None):
    '''
    

    '''
    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Directory \'{0}\' is set to be pruned'.format(
            name)
        return ret

    try:
        call = __salt__['bower.prune'](dir=name, runas=user, env=env)
    except (CommandNotFoundError, CommandExecutionError) as err:
        ret['result'] = False
        ret['comment'] = 'Error pruning \'{0}\': {1}'.format(name, err)
        return ret

    ret['result'] = True
    if call:
        ret['comment'] = 'Directory \'{0}\' was successfully pruned'.format(name)
        ret['changes'] = {'old': [], 'new': call}
    else:
        ret['comment'] = 'No packages were pruned from directory \'{0}\''.format(name)

    return ret
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);
    }
984735
def run(self, args):
        
        email = args.email                  # email of person to send email to
        username = args.username            # username of person to send email to, will be None if email is specified
        force_send = args.resend            # is this a resend so we should force sending
        auth_role = args.auth_role          # authorization role(project permissions) to give to the user
        msg_file = args.msg_file            # message file who's contents will be sent with the share
        message = read_argument_file_contents(msg_file)
        print("Sharing project.")
        to_user = self.remote_store.lookup_or_register_user_by_email_or_username(email, username)
        try:
            project = self.fetch_project(args, must_exist=True, include_children=False)
            dest_email = self.service.share(project, to_user, force_send, auth_role, message)
            print("Share email message sent to " + dest_email)
        except D4S2Error as ex:
            if ex.warning:
                print(ex.message)
            else:
                raise
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)
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
45754
def _add_project_filter_auth_role_arg(arg_parser):
    
    help_text = "Filters project listing to just those projects with the specified role. "
    help_text += "See command list_auth_roles for AuthRole values."
    arg_parser.add_argument("--auth-role",
                            metavar='AuthRole',
                            type=to_unicode,
                            dest='auth_role',
                            help=help_text,
                            default=None)