Skip to contents

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

user

User ID

app_name

Application Name

pin_name

Pin name

pin_list

List of pins

pin_board

Pin board object

access_panels

Available access panels

access_units

Available access units

access_mode

Access mode, e.g., "default", "single unit"

user_df

Data frame of user IDs and names

switch_size

Size of UI switch elements (e.g., "small", "large", "default", "mini", "small", "normal", "large")

unit_display

Display type for access units ("switch", "dropdown")

board_type

Type of pin board ("local", "s3", "rconnect")

local_board_path

Local path for local pin boards

s3_bucket

S3 bucket name

s3_access_key

S3 access key

s3_secret_key

S3 secret key

use_rconnect_users

Boolean, use rconnect users in conjunction with user_df

config

Configuration file content

data

List of data paths from config

verbose

Boolean, whether to print logs

panel_config

Complete panel structure

secure_mode

Boolean, 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

user

User ID

app_name

App Name

pin_name

A field that takes the argument pin_name

pin_list

A field that takes the argument pin_list

pin_board

A field that takes the argument pin_board

access_panels

A field that takes the argument access_panels

access_units

A field that takes the argument access_units

access_mode

Enables 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_df

A data.frame with user id and user name

switch_size

Takes values : 'default', 'mini', 'small', 'normal', 'large'. Determines the size of access unit switches used in the module.

unit_display

Takes values : 'switch', 'dropdown'. Determines the type of display for access units. Defaults to 'switch'.

board_type

Board type. Takes values "local", "s3", "rconnect"

local_board_path

Local board path.

s3_bucket

S3 bucket

s3_access_key

S3 Access Key

s3_secret_key

S3 Secret Key

use_rconnect_users

If true then rconnect users will be combined with the given user_df

config

rAccess configuration file

data

Lists all datapaths in config file

verbose

If TRUE, prints all data base updates in the log

panel_config

A list with entire panel structure including datapaths

secure_mode

If 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

user

User ID

pin_board

Pin board

app_name

App name

pin_name

Pin name

access_panels

Access panels

access_units

Access units

access_mode

Access mode

user_df

Data Frame with username and userid

switch_size

Determines size of access unit switches : default, mini, small, normal, large

unit_display

Determines the type of display for access units : switch, dropdown.

board_type

Pin board type: local, s3, rconnect

local_board_path

Local path to save pin_board when board_type is local.

s3_bucket

S3 bucket id

s3_access_key

Access key to S3 bucket

s3_secret_key

Secret Key to S3 bucket

use_rconnect_users

If TRUE, then rconnect users will be combined with user_df when deployed.

config

rAccess configuration file

verbose

If TRUE, prints all data base updates in the log

secure_mode

If TRUE, then user should have access to at least one access_unit/access_panel to use the app.

Returns

pin_name, access_panels, access_units, Pin_board ...


Method matched_users()

Find users matching search input in self$user_df

Usage

rAccess$matched_users(contact_info)

Arguments

contact_info

User entered search text

Returns

A data.frame


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

Usage

rAccess$check_access(user_id = self$user, access_panel)

Arguments

user_id

User ID

access_panel

Access Panel name


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.

Usage

rAccess$is_admin()


Method no_admin()

check if there is no user in the ADMIN panel Returns FALSE if there is one or more admins.

Usage

rAccess$no_admin()


Method get_userlist_unit()

Gets user list filtered by given access unit

Usage

rAccess$get_userlist_unit(access_panel, access_unit)

Arguments

access_panel

Access panel name

access_unit

Access unit name


Method rAccessThemes()

Function to inline js/css into the main app’s HTML

Usage

rAccess$rAccessThemes()


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.

Usage

rAccess$get_user_accesslist(user_id = self$user)

Arguments

user_id

User ID

Returns

A list


Method get_superAdmins()

Function to get app admins

Usage

rAccess$get_superAdmins()

Returns

ADMIN user ids


Method clone()

The objects of this class are cloneable with this method.

Usage

rAccess$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.