Read only Admin - pc2ccs/pc2v9 GitHub Wiki

The Administrator Module (GUI) provides the ability to control a contest and change configuration of a contest.

Read-only admin and pc2 permissions

A read-only Admin GUI will allow a user to view contest information but not allow changes.

PC2 enforces a number of Permissions which control what each module can do, for example to edit a run (on the Admin) the permission EDIT_RUN must be added/enabled.

Permissions for all accounts can be viewed using the Account Permissions Report, which lists both the enum name, ex. EDIT_RUN, and the description, ex. "Edit a run".

The permissions can be viewed or changed using the Admin's Edit Account (Account tab -> Edit button).

Option 1 - create read-only using yaml

To create a read-only admin one must remove (disable) permissions. The yaml permissions section can be used to disable those permissions.

See the example yaml below that would make Administrator 8 a read-only admin.

Option 2 to create a read-only using the Admin GUI

The Edit Account feature can be used to enable/disable permissions. This method is manual and a permission might be missed.

Navigate to edit an account by:

  1. Admin GUI
  2. select Configure Contest
  3. select Accounts Tab
  4. select an account
  5. select Edit to edit an account

Example yaml to create a read-only admin

Here is a yaml example to create a read-only admin 8.

permissions:

  - account: ADMINISTRATOR
    number: 8

    disable: ADD_ACCOUNT,ADD_CATEGORY,ADD_GROUPS,ADD_JUDGEMENTS,ADD_LANGUAGE,ADD_NOTIFICATIONS,ADD_PROBLEM,ADD_SETTINGS,ADD_SITE,ALLOWED_TO_AUTO_JUDGE,ALLOWED_TO_FETCH_RUN,ALLOWED_TO_RECONNECT_SERVER,ANSWER_CLARIFICATION,BALLOON_OUTPUT_SHUTOFF,CLONE_PROFILE,EDIT_ACCOUNT,EDIT_AJ_SETTINGS,EDIT_CATEGORY,EDIT_CLARIFICATION,EDIT_CONTEST_CLOCK,EDIT_EVENT_FEED,EDIT_GROUPS,EDIT_JUDGEMENTS,EDIT_LANGUAGE,EDIT_NOTIFICATIONS,EDIT_PERMISSIONS,EDIT_PLAYBACK,EDIT_PROBLEM,EDIT_RUN,EDIT_SITE,EXECUTE_RUN,FORCE_LOGOFF_CLIENT,FORCE_LOGOFF_SERVER,GENERATE_NEW_CLARIFICATION,GIVE_CLARIFICATION,GIVE_RUN,JUDGE_RUN,REJUDGE_RUN,RESET_CONTEST,SHADOW_PROXY_TEAM,SHUTDOWN_ALL_SERVERS,SHUTDOWN_SERVER,START_CONTEST_CLOCK,START_PLAYBACK,STOP_CONTEST_CLOCK,STOP_PLAYBACK,SUBMIT_CLARIFICATION,SUBMIT_RUN,SWITCH_PROFILE,TAKE_CLARIFICATION,TAKE_RUN,TEST_RUN

enabled permission for read-only Admin

After the yaml for admin 8 is used, here are the permissions that admin 8 has:

Type: ADMINISTRATOR
  administrator8 (site 1) 
    1 CHANGE_PASSWORD Change password
    2 LOGIN Login
    3 VIEW_CLARIFICATIONS View Clarifications
    4 VIEW_RUNS View Runs
    5 VIEW_ALL_JUDGEMENTS Execute but not judge runs
    6 VIEW_STANDINGS View standings
    7 VIEW_DELETED_RUNS View deleted runs
    8 VIEW_SUMMARY_ATTEMPTS_GRID View Summary Attempts Grid
    9 VIEW_RUN_JUDGEMENT_HISTORIES View run judgement histories
    10 EXTRACT_RUNS Extract run contents from runs database
    11 VIEW_SECURITY_ALERTS View Security Alerts Log/View
    12 EXPORT_PROFILE Export Profile
    13 VIEW_PASSWORDS View Passwords
    14 VIEW_EVENT_FEED View Event Feeds