Adjustment Rights
Adjustments are limited to administrator users but this can be changed. Depending on your needs, standard users can be granted different levels of control.
By default, only users with administrator privileges can affect pending triggers.
Standard users, those without administrator privileges for the computer, can not adjust or cancel pending triggers. This limitation is to protect other users from unexpected schedule changes.
Adjustments by non-administrators
Sometimes it is desirable to give standard users the ability to make adjustments.
There are two approaches available: the first limits control to a only immediately due triggers, and the second offers complete control over pending triggers.
When some non-administrator control is required, we recommend minimising the rights granted to non-administrator users. Do not grant rights to non-administrator without careful consideration of the consequences.
Limited control to postpone and cancel
It is often desirable to grant some ability to delay or cancel immediately due triggers to the active user.
Consider the situation where a shut down is scheduled to occur in ten minutes but the user needs a little more time to complete their work. Allowing the user to postpone the shut down is helpful; so long as the postponement is limited in duration and only possible close to the due time. This is possible.
Power Manager can allow standard users to postpone, and even cancel, pending triggers in specific situations. Power Manager can also enforce constraints on the length of the postponement.
If the user does not have rights to adjust, cancel, or reset pending events, then Power Manager checks for two additional rights:
notifications.postpone
notifications.cancel
By default, these rights are administrator only. When granted to a user, these rights allow adjustments to currently notifying pending triggers.
Note that these rights do not affect pending triggers that are not notifying or that do not notify.
By affecting only a selection of pending triggers, we gain the ability to create schedules containing quiet triggers that can not be adjusted, and notifying events that can be adjusted.
Additionally, events can set an event specific behaviour to stop notifying triggers from being adjusted despite the rights above being granted.
Postpone
In most cases, granting the notifications.postpone
right to standard users will provide the behaviour you need.
A notifying trigger can be postponed. This is similar to be adjusted but with constraints:
- The pending trigger must be within the notify period and thus notifying;
- Postpone can not advance the trigger closer in time beyond its original due date;
- Postpone can not delay the trigger further in time beyond the postpone period, relative to the trigger’s original due date.
Granting notifying postpone and cancel rights
To grant postpone notifying right to all users:
./pmctl authorisation.applyright signature=notifications.postpone rule=universal
To grant cancel notifying right to all users:
./pmctl authorisation.applyright signature=notifications.cancel rule=universal
Resetting postpone and cancel rights
To reset a single right to its default rule, omit the rule parameter.
./pmctl authorisation.applyright signature=notifications.postpone
To reset multiple rights in a single command:
./pmctl authorisation.applyright signature=notifications.postpone authorisation.applyright signature=notifications.cancel
Changes to rights take effect immediately. To confirm the rights have been applied as desired, list and check them using the command:
./pmctl -format json authorisation.rights
Postpone Period
The maximum time a notifying trigger can be postponed is controlled by the postpone period.
The default postpone period is an hour. This can be changed using the request notifications.setpostponeperiod
and providing the number of seconds to use.
The current postpone period, in seconds, can be read with the pmctl
command:
./pmctl -format json notifications.postponeperiod
To set the postpone period to 15 minutes (900 seconds):
./pmctl notifications.setpostponeperiod seconds:integer=900
To reset the postpone period to the default duration, omit the seconds parameter:
./pmctl notifications.setpostponeperiod
Complete control to make adjustments
Sometimes non-administrators require complete control to adjust pending triggers. This is possible with Power Manager. Granting the rights below allows users to affect all pending triggers, regardless of their time in the future and notifying state.
The signatures of the Power Manager rights controlling who can make adjustments are:
scheduler.adjust
scheduler.cancel
scheduler.reset
These rights are associated with their API requests that enact the adjustments. By default, only administrators have these rights.
You can confirm this using the pmctl
command below:
./pmctl -format json authorisation.rights
This command outputs a JSON formatted list which includes the items:
[{
"default rule": "administrator",
"rule": "administrator",
"signature": "scheduler.cancel"
},
{
"default rule": "administrator",
"rule": "administrator",
"signature": "scheduler.adjust"
},
{
"default rule": "administrator",
"rule": "administrator",
"signature": "scheduler.reset"
}]
Granting adjust, cancel, and reset rights
To grant non-administrator users the right to adjust, cancel, or reset pending triggers use the commands below.
These rights can be granted individually. There is no requirement to grant all three.
To grant adjust rights:
./pmctl authorisation.applyright signature=scheduler.adjust rule=universal
To grant cancel rights:
./pmctl authorisation.applyright signature=scheduler.cancel rule=universal
To grant reset rights:
./pmctl authorisation.applyright signature=scheduler.reset rule=universal
To grant adjust, cancel, and reset rights in a single command:
./pmctl authorisation.applyright signature=scheduler.adjust rule=universal authorisation.applyright signature=scheduler.cancel rule=universal authorisation.applyright signature=scheduler.reset rule=universal
Changes to rights take effect immediately. To confirm the rights have been applied as desired, list and check them using the command:
./pmctl -format json authorisation.rights
Resetting adjust, cancel, and reset rights
To reset a single right to its default rule, omit the rule parameter.
./pmctl authorisation.applyright signature=scheduler.adjust
To reset multiple rights in a single command:
./pmctl authorisation.applyright signature=scheduler.adjust authorisation.applyright signature=scheduler.cancel authorisation.applyright signature=scheduler.reset