Provides codes and associated authorizing statutes.
510184
def authority(self, column=None, value=None, **kwargs):
        """"""
        return self._resolve_call('GIC_AUTHORITY', column, value, **kwargs)
1112769
def authorize(self):
        '''
        
        '''
        with salt.utils.files.fopen(self.path, 'w+') as fp_:
            fp_.write(str(int(time.time())))  # future lint: disable=blacklisted-function
        return True
922168
function importAuthCodes(channel, codes, settings) {
    var authDir, outFile, outFileBak;

    channel.registry.importClients(codes);

    authDir = settings.authDir;
    if (settings.dumpCodes !== false) {
        outFile = settings.outFile || 'codes.imported.csv';
        if (!path.isAbsolute(outFile)) {
            outFile = path.join(settings.authDir, outFile);
        }
        outFileBak = outFile + '.bak';

        fs.rename(outFile, outFileBak, function() {
            var NDDB, db;
            NDDB = require('NDDB').NDDB;
            db = new NDDB();
            db.importDB(codes);
            // Async function. Throws errors.
            db.save(outFile);
        });
    }

    // Not needed anymore.
    delete settings.authDir;
}
1255889
@NotNull
    @ObjectiveCName("validateCodeCommand:")
    public Command<AuthState> validateCode(final String code) {
        return modules.getAuthModule().requestValidateCode(code);
    }
1008618
def set_code_exprs(self, codes):
        """"""
        self.code_objs = dict()
        self._codes = []
        for code in codes:
            self.append_code_expr(code)
297029
def authorize(self, ctx, identity, ops):
        '''
        '''
        allowed = []
        caveats = []
        for op in ops:
            ok, fcaveats = self._f(ctx, identity, op)
            allowed.append(ok)
            if fcaveats is not None:
                caveats.extend(fcaveats)
        return allowed, caveats
562678
def _has_desired_permit(permits, acategory, astatus):
    
    if permits is None:
        return False
    for permit in permits:
        if permit.category_code == acategory and\
           permit.status_code == astatus:
            return True
    return False
1112995
protected Collection<? extends GrantedAuthority> buildGrantedAuthorities(PortletRequest context) {
        Collection<String> portletUserRoles = getUserRoles(context);
        Collection<? extends GrantedAuthority> userGas = portletUserRoles2GrantedAuthoritiesMapper.getGrantedAuthorities(portletUserRoles);

        if (logger.isDebugEnabled()) {
            logger.debug("Portlet roles [" + portletUserRoles + "] mapped to Granted Authorities: [" + userGas + "]");
        }
        return userGas;
    }
1131896
public static Authorization append(Authorization a, Authorization b) {
        if (a instanceof AclRuleSetSource && b instanceof AclRuleSetSource) {
            return RuleEvaluator.createRuleEvaluator(
                    merge((AclRuleSetSource) a, (AclRuleSetSource) b)
            );
        }
        return new MultiAuthorization(a, b);
    }
1146453
protected void buildAuthorizationConfig() {
        Properties loaded = new Properties();
        InputStream configuration = this.getClass().getResourceAsStream("/case-authorization.properties");
        if (configuration != null) {            
            try {
                loaded.load(configuration);
            } catch (IOException e) {
                logger.error("Error loading case autorization config from file due to {}", e.getMessage(), e);
            }            
        }        

        Stream.of(ProtectedOperation.values()).forEach(operation -> {
           List<String> roles = new ArrayList<>();
           String grantedRoles = loaded.getProperty(operation.toString());
           if (grantedRoles != null) {
               roles.addAll(Arrays.asList(grantedRoles.split(",")));
           }
           operationAuthorization.put(operation, roles);
        });
    }
755961
public function createAuthorizerApplication($authorizerCorpId, $permanentCode)
    {
        $this->fetch('authorization')
             ->setAuthorizerCorpId($authorizerCorpId)
             ->setAuthorizerPermanentCode($permanentCode);

        $application = $this->fetch('app');
        $application['access_token'] = $this->fetch('authorizer_access_token');
        $application['oauth'] = $this->fetch('oauth');

        return $application;
    }
1333975
protected void createDefaultAuthorizations(ExecutionEntity execution) {
    if(execution.isProcessInstanceExecution() && isAuthorizationEnabled()) {
      ResourceAuthorizationProvider provider = getResourceAuthorizationProvider();
      AuthorizationEntity[] authorizations = provider.newProcessInstance(execution);
      saveDefaultAuthorizations(authorizations);
    }
  }
753776
private void authorize() {
        Map<String, String> param = new HashMap<>();
        param.put("clientId", clientId);
        param.put("authorizeToken", authorizeToken);
        String result = HttpUtils.sendPost(authorizeUrl, param);
        Map<String, String> resultMap = parseHttpKvString(result);
        if (resultMap.isEmpty()) {
            throw new GetSequenceFailedException("clientId:" + clientId + " authorize failed, return message is empty");
        } else {
            if (resultMap.get("errorCode") != null) {
                throw new GetSequenceFailedException("clientId:" + clientId + " authorize failed, return message is: "
                                                     + result);
            }
            String accessUrl = resultMap.get("accessUrl");
            String accessToken = resultMap.get("accessToken");
            if (accessUrl == null || accessToken == null) {
                throw new GetSequenceFailedException(
                                                     "clientId:"
                                                             + clientId
                                                             + " authorize failed, accessUrl or accessToken is null, detail message is "
                                                             + result);
            }
            try {
                accessUrl = URLDecoder.decode(accessUrl.trim(), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                throw new GetSequenceFailedException(e);
            }
            this.accessUrl = accessUrl;
            this.accessToken = accessToken;
        }
    }
1283116
public function handleAuthorize(string $authCode = null)
    {
        $params = [
            'component_appid' => $this->app['config']['app_id'],
            'authorization_code' => $authCode ?? $this->app['request']->get('auth_code'),
        ];

        return $this->httpPostJson('cgi-bin/component/api_query_auth', $params);
    }
824228
def authorized?(action, subject)
      return false unless subject
      klass = subject.is_a?(Class) ? subject : subject.class
      authorizer_of(klass).authorized? action, subject
    end
886346
public static SnsToken oauth2ComponentAccessToken(String appid,String code,String component_appid,String component_access_token ){
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setUri(BASE_URI + "/sns/oauth2/component/access_token")
				.addParameter("appid", appid)
				.addParameter("code", code)
				.addParameter("grant_type", "authorization_code")
				.addParameter("component_appid", component_appid)
				.addParameter("component_access_token", component_access_token)
				.build();
		return LocalHttpClient.executeJsonResult(httpUriRequest,SnsToken.class);
	}
323176
public function getAuthorizationCode($code)
    {
        $code = $this->getObjectByType('code_table',$code);

        return is_null($code) ? false : $code;
    }