Applies an action to the selected credentials
18749
protected function actionListCredential()
    {
        list($selected, $action) = $this->getPostedAction();

        $deleted = 0;

        foreach ($selected as $id) {
            if ($action === 'delete' && $this->access('module_gapi_credential_delete')) {
                $credential = $this->credential->get($id);
                $deleted += (int) $this->credential->callHandler($credential['type'], 'delete', array(
                    $credential['credential_id']));
            }
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
1300476
def change_credentials(self, user=None, auth_token=None):
        
        self.r_session.set_credentials(user, auth_token)
        self.r_session.login()
1034073
private Action handleAddUpdateActionStatus(final JpaActionStatus actionStatus, final JpaAction action) {

        String controllerId = null;
        LOG.debug("handleAddUpdateActionStatus for action {}", action.getId());

        // information status entry - check for a potential DOS attack
        assertActionStatusQuota(action);
        assertActionStatusMessageQuota(actionStatus);

        switch (actionStatus.getStatus()) {
        case ERROR:
            final JpaTarget target = (JpaTarget) action.getTarget();
            target.setUpdateStatus(TargetUpdateStatus.ERROR);
            handleErrorOnAction(action, target);
            break;
        case FINISHED:
            controllerId = handleFinishedAndStoreInTargetStatus(action);
            break;
        case DOWNLOADED:
            controllerId = handleDownloadedActionStatus(action);
            break;
        default:
            break;
        }

        actionStatus.setAction(action);
        actionStatusRepository.save(actionStatus);
        final Action savedAction = actionRepository.save(action);

        if (controllerId != null) {
            requestControllerAttributes(controllerId);
        }

        return savedAction;
    }
262965
def register_actions(self, shortcut_manager):
        
        shortcut_manager.add_callback_for_action('rename', self.rename_selected_state)
        super(StatesEditorController, self).register_actions(shortcut_manager)
1120475
def handleActionTrigger(self, action):
        
        # trigger a particular profile
        if isinstance(action, XViewProfileAction):
            # if the user CTRL+Clicks on the action, then attempt
            # to load it in a new window
            if QApplication.keyboardModifiers() == Qt.ControlModifier:
                self.newWindowProfileRequested.emit(action.profile())
                self.setCurrentProfile(self.currentProfile())
                return
            else:
                self.setCurrentProfile(action.profile())
801654
def cli(ctx):
    """"""
    dir_path = os.path.join(os.path.expanduser('~'), '.keep', '.credentials')
    if os.path.exists(dir_path):
        if click.confirm('[CRITICAL] Reset credentials saved in ~/.keep/.credentials ?', abort=True):
            os.remove(dir_path)
    utils.register()
16244
async def ChangeModelCredential(self, model_credentials):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='ModelManager',
                   request='ChangeModelCredential',
                   version=5,
                   params=_params)
        _params['model-credentials'] = model_credentials
        reply = await self.rpc(msg)
        return reply
829880
function (oNode) {
			if (oNode) {
				if (oNode.nodeState.selected && !oNode.isArtificial) {
					aResultContexts.push(oNode.context);
				}
			}
		}
668136
def get_next_action(self, request, application, label, roles):
        
        actions = self.get_actions(request, application, roles)
        if label is None and \
                'is_applicant' in roles and 'is_admin' not in roles:
            # applicant, admin, leader can reopen an application
            for action in actions:
                if action in request.POST:
                    return action
            return render(
                template_name='kgapplications/common_declined.html',
                context={
                    'application': application,
                    'actions': actions,
                    'roles': roles
                },
                request=request)
        return super(StateDeclined, self).get_next_action(
            request, application, label, roles)
753359
public void init(String username, Credentials credentials) {
        this.credentials = credentials;
        setIdentifier(username.toLowerCase());
    }
387814
def authorize_for(opts = {})
      authorize! opts[:action], opts[:resource] if opts[:resource].present?
      authorize! opts[:action], opts[:object] if opts[:object].present?
    end
800665
public function authorizeAction()
    {
        $request = $this->getController()->request;
        $action = $request->getParam('action');

        $skipAuthorization = $this->checkAction($action, 'skipAuthorization');
        if ($skipAuthorization) {
            $this->skipAuthorization();

            return;
        }

        $authorizeModel = $this->checkAction($action, 'authorizeModel');
        if ($authorizeModel) {
            $this->authorize($this->getController()->loadModel());
        }
    }
716934
function(repository){
			var credentials = {
				gitSshUsername : "",
				gitSshPassword : "",
				gitPrivateKey : "",
				gitPassphrase : ""
			};
			
			var d = new Deferred();
			this._preferenceService.get(this._prefix, undefined, {scope: 2}).then(
				function(pref){
					var settings = pref["settings"];
					if(settings === undefined){
						d.reject();
						return;
					}
				
					if(settings.enabled){
						var userCredentials = pref[repository];
						if(userCredentials !== undefined) { d.resolve(userCredentials); }
						else { d.resolve(credentials); }
					} else { d.reject(); }
				}
			);
			
			return d;
		}
1262002
def get_actions(self, request):
        
        actions = super(CertificateMixin, self).get_actions(request)
        actions.pop('delete_selected', '')
        return actions
406323
function action() {
    var self = Thng.resourceConstructor.call(this, this.id);
    return self.action.apply(self, arguments);
  }
530010
public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException
    {
        if ((MenuConstants.CHANGE_PASSWORD.equalsIgnoreCase(strCommand)) && (properties != null))
        {
            Record recUserInfo = Record.makeRecordFromClassName(UserInfoModel.USER_INFO_FILE, this);
            Object objErrorCode = null;
            try {
                String strUserName = (String)properties.get(Params.USER_NAME);
                if (strUserName == null)
                    strUserName = (String)properties.get(Params.USER_ID);
                String strCurrentPassword = (String)properties.get(Params.PASSWORD);
                String strNewPassword = (String)properties.get("newPassword");
                if (((UserInfoModel)recUserInfo).getUserInfo(strUserName, false) == false)
                    throw new RemoteException(this.getString("Error, user name is incorrect."));
                if ((recUserInfo.getField(UserInfoModel.PASSWORD).isNull()) || (!recUserInfo.getField(UserInfo.PASSWORD).toString().equals(strCurrentPassword)))
                    throw new RemoteException(this.getString("Error, current password was incorrect."));
                if ((strNewPassword == null) || (strNewPassword.length() == 0))
                    throw new RemoteException(this.getString("Error, new password can't be empty."));
                recUserInfo.edit();
                recUserInfo.getField(UserInfoModel.PASSWORD).setString(strNewPassword);
                recUserInfo.set();
                objErrorCode = new Integer(DBConstants.NORMAL_RETURN);  // Success!
            } catch (DBException ex) {
                throw ex;
            } finally {
                recUserInfo.free();
            }
            return objErrorCode;
        }
        else if ((MenuConstants.CREATE_NEW_USER.equalsIgnoreCase(strCommand)) && (properties != null))
        {
            Record recUserInfo = Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS, this);
            ((UserInfoModel)recUserInfo).setupNewUserHandler();
            Object objErrorCode = null;
            try {
                String strUserName = (String)properties.get(Params.USER_NAME);
                String strPassword = (String)properties.get(Params.PASSWORD);
                if (((UserInfoModel)recUserInfo).getUserInfo(strUserName, false) == true)
                    throw new RemoteException(this.getString("Error, user name already exists."));
                recUserInfo.addNew();
                recUserInfo.getField(UserInfoModel.USER_NAME).setString(strUserName);
                recUserInfo.getField(UserInfoModel.PASSWORD).setString(strPassword);
                recUserInfo.add();
                objErrorCode = new Integer(DBConstants.NORMAL_RETURN);  // Success!
            } catch (DBException ex) {
                throw ex;
            } finally {
                recUserInfo.free();
            }
            return objErrorCode;
        }
        else if ((DBParams.TABLE_PATH.equalsIgnoreCase(strCommand)) && (properties != null))
        {
            //String dataType = (String)properties.get(YDatabase.DATA_TYPE);
            String recordClass = (String)properties.get(YDatabase.RECORD_CLASS);
            String tableName = (String)properties.get(YDatabase.TABLE_NAME);
            String language = (String)properties.get(Params.LANGUAGE);
        	
            try {
            	ByteArrayOutputStream ostream = new ByteArrayOutputStream();
				NetUtility.getNetTable(recordClass, tableName, language, this, this, this, ostream);
				return ostream.toByteArray();
			} catch (IOException e) {
				e.printStackTrace();
			}
        }
        return super.doRemoteAction(strCommand, properties);
    }
783368
def activate(options = {})
      options = options.merge(
        user_name: @user_name,
        access_key_id: @id,
        status: "Active"
      )
      resp = @client.update_access_key(options)
      resp.data
    end