These functions handle validation and authorisation of files stored on a SharePoint site via the Microsoft Graph API, updating corresponding metadata fields and optionally interacting with Microsoft Planner for workflow management.
validate_request_file(
drive_item,
local_file = NULL,
planner = connect_planner()
)
validate_file(
drive_item,
user = Sys.info()["user"],
authorise_request = FALSE,
teams = connect_teams(),
planner = connect_planner()
)
authorise_file(
drive_item,
user = Sys.info()["user"],
teams = connect_teams(),
planner = connect_planner()
)
a Drive Item object of a file
a Planner account, e.g. outcome of connect_planner()
a Certe user, who is member of the SharePoint site where file
is stored
option to request for authorisation after validation
a Teams account, e.g. outcome of connect_teams()
a location of the local file. If set, this will allow a direct Positron link on the attachment of the Planner task.
The functions in this set operate on Microsoft 365 Drive Items (class ms_drive_item
) and are designed to work within a controlled document workflow involving SharePoint and Planner:
validate_request_file()
creates a label on a Planner task requesting validation for a file.
validate_file()
writes a timestamp and user ID to the file's metadata to record validation, using the authenticated Teams token. If authorise_request = TRUE
, it also triggers a request for authorisation by labelling a task in Planner associated with the parent folder of the file.
authorise_file()
writes a timestamp and user ID to the file's metadata to reflect authorisation of the file. It also labels the associated Planner task to indicate successful authorisation.
All API calls use the Microsoft Graph API and require appropriate OAuth tokens via Teams or Planner accounts. The structure assumes SharePoint lists are configured with custom metadata columns for validation and authorisation tracking.