Access time control

You can restrict session creation to certain times of the day or days of the week.

Session restrictions are defined by the ACCESS TIME clause.
  • If the USER has a specific setting, that setting is used.
  • If the USER has no setting, but the GROUP statement of the user has a specific setting, the group setting is used.
  • If any GROUP of the user explicitly disallows access, then the session creation is rejected.
  • If a USER belongs to different GROUPS with different access times, the most restrictive GROUP setting is used. So a USER is allowed access if none of the GROUPS restricts the time.
The following table shows command examples for different restrictions on a user. The days are numbered 1 - 7, beginning with Sunday as 1.
Table 1. Restriction setting examples
Restriction Definition
ACCESS TIME ALL; No restriction on access.
ACCESS TIME DEFAULT; Restrictions are defined by GROUP settings.
ACCESS TIME (DAY ALL START '8:00' END '18:00'); Access is allowed every day from 8:00 a.m. to 6:00 p.m.
ACCESS TIME (DAY 3,4,5 START '7:00' END '18:00', DAY 2, 6 START '6:00' END '15:00'); Access is allowed Tuesday, Wednesday, and Thursday from 7:00 a.m. to 6:00 p.m., and on Monday and Friday from 6:00 a.m. to 3:00 p.m.

The times define when users can log in, but users can remain on the system past the restriction time, if they logged in during the allowed timeframe and do not log out.

The following example creates a user with a concurrent session limit of 2 and an access time that ranges from 7:00 a.m. to 7:00 p.m.:
SYSTEM(ADMIN)=> CREATE USER jdoe CONCURRENT SESSIONS 2 ACCESS TIME 
(DAY ALL START '7:00' END '19:00');
CREATE USER
The following example creates a group with a concurrent session limit of 8 and an access time that ranges from Tuesday to Thursday, from 9:00 a.m. to 6:00 p.m.:
SYSTEM(ADMIN)=> CREATE GROUP finance CONCURRENT SESSIONS 8 ACCESS TIME 
(DAY 3,4,5 START '9:00' END '18:00');
CREATE GROUP