Name

apply right, authorisation.applyright, kPMRPCAuthorisationApplyRight — Set a rule for a right.

Synopsis

void authorisation.applyright( signature,
rule);
signature : string, default, length 1..255;
rule : string, choice, optional;

Description

Set a rule for a right.

apply right modifies a single right. Rights are indexed by their signature with one right per signature.

Parameters

signature. Signature of the right to modify. signature is a string. If signature is omitted, a default is created. signature must be between 1 and 255 characters long, inclusive.

rule. Rule to associate with right. If omitted, default right is set. rule is a string. rule is optional. rule must be one of the following two constants:

  • universal, kPMRPCParameterRule_ApplyRight_Universal.
  • administrator, kPMRPCParameterRule_ApplyRight_Administrator.

Security

apply right can be requested by any authenticated client.

Unauthenticated clients are authorized using the uk.co.dssw.powermanager.authorisation.applyright right. By default, only local processes belonging to administrator can send a apply right request.

Availablility

pmdctl

Examples

Example 22. C: Minimal authorisation.applyright

CFStringRef myRule = NULL;

...
CFMutableDictionaryRef myRequest = PMRequestCreateWithParameters(kCFAllocatorDefault, kPMRPCAuthorisationApplyRight, kPMRPCParameterRule, myRule, nil);