The rAccess class encapsulates various methods used in the IAM (Identity
and Access Management) module.
It provides functionalities to check user permissions, verify admin status,
retrieve user details,
and interact with pin boards for access control configuration.
Fields
userUser ID
app_nameApplication Name
pin_namePin name
pin_listList of pins
pin_boardPin board object
access_panelsAvailable access panels
access_unitsAvailable access units
access_modeAccess mode, e.g., "default", "single unit"
user_dfData frame of user IDs and names
switch_sizeSize of UI switch elements (e.g., "small", "large", "default", "mini", "small", "normal", "large")
unit_displayDisplay type for access units ("switch", "dropdown")
board_typeType of pin board ("local", "s3", "rconnect")
local_board_pathLocal path for local pin boards
s3_bucketS3 bucket name
s3_access_keyS3 access key
s3_secret_keyS3 secret key
use_rconnect_usersBoolean, use rconnect users in conjunction with user_df
configConfiguration file content
dataList of data paths from config
verboseBoolean, whether to print logs
panel_configComplete panel structure
secure_modeBoolean, enforce access requirement
Methods
initialize(user, ...)Constructor to create an instance with specified parameters.
check_access(user_id, access_panel)Checks user access rights for a given panel.
is_admin()Checks if the current user is an admin.
no_admin()Checks if there are no admins in the admin panel.
get_userlist_unit(access_panel, access_unit)Gets list of users with access to the specified unit.
rAccessThemes()Includes custom CSS themes for the app.
get_user_accesslist(user_id)Lists access units available to a user, including "everyone".
get_superAdmins()Returns list of admin user IDs.
Public fields
userUser ID
app_nameApp Name
pin_nameA field that takes the argument pin_name
pin_listA field that takes the argument pin_list
pin_boardA field that takes the argument pin_board
access_panelsA field that takes the argument access_panels
access_unitsA field that takes the argument access_units
access_modeEnables user to select access modes.Available access modes are : default - Allows access to multiple access panels and multiple access units, single unit - Allows access to single access unit within an access panel.
user_dfA data.frame with user id and user name
switch_sizeTakes values : 'default', 'mini', 'small', 'normal', 'large'. Determines the size of access unit switches used in the module.
unit_displayTakes values : 'switch', 'dropdown'. Determines the type of display for access units. Defaults to 'switch'.
board_typeBoard type. Takes values "local", "s3", "rconnect"
local_board_pathLocal board path.
s3_bucketS3 bucket
s3_access_keyS3 Access Key
s3_secret_keyS3 Secret Key
use_rconnect_usersIf true then rconnect users will be combined with the given user_df
configrAccess configuration file
dataLists all datapaths in config file
verboseIf TRUE, prints all data base updates in the log
panel_configA list with entire panel structure including datapaths
secure_modeIf TRUE, then user should have access to at least one access_unit/access_panel to use the app.
Methods
Method new()
Constructor to initialize an rAccess object
Usage
rAccess$new(
user = NULL,
pin_board = NULL,
app_name = NULL,
pin_name = NULL,
access_panels,
access_units = NULL,
access_mode = "default",
user_df = NULL,
switch_size = NULL,
unit_display = "switch",
board_type = NULL,
local_board_path = NULL,
s3_bucket = NULL,
s3_access_key = NULL,
s3_secret_key = NULL,
use_rconnect_users = TRUE,
config = NULL,
verbose = FALSE,
secure_mode = FALSE
)Arguments
userUser ID
pin_boardPin board
app_nameApp name
pin_namePin name
access_panelsAccess panels
access_unitsAccess units
access_modeAccess mode
user_dfData Frame with username and userid
switch_sizeDetermines size of access unit switches :
default,mini,small,normal,largeunit_displayDetermines the type of display for access units :
switch,dropdown.board_typePin board type:
local,s3,rconnectlocal_board_pathLocal path to save pin_board when board_type is
local.s3_bucketS3 bucket id
s3_access_keyAccess key to S3 bucket
s3_secret_keySecret Key to S3 bucket
use_rconnect_usersIf TRUE, then rconnect users will be combined with user_df when deployed.
configrAccess configuration file
verboseIf TRUE, prints all data base updates in the log
secure_modeIf TRUE, then user should have access to at least one access_unit/access_panel to use the app.
Method check_access()
To check user access rights to an access unit within a particular access panel. Returns access details from the app's access pin board that matches given user_id and access panel
Method is_admin()
To check if the user is Admin in order to provide access to IAM module. Returns TRUE if it is an admin user.
Method no_admin()
check if there is no user in the ADMIN panel Returns FALSE if there is one or more admins.
Method get_user_accesslist()
Function to get list of access units for a given user.
Note that it will contain access units that are accessible by everyone.