User Permission
DearDiary.get_userpermission — Functionget_userpermission(user_id::Integer, project_id::Integer)::Optional{UserPermission}Get a UserPermission by User id and Project IDs.
Arguments
user_id::Integer: The id of the user.project_id::Integer: The id of the project.
Returns
A UserPermission object. If the record does not exist, return nothing.
DearDiary.create_userpermission — Functioncreate_userpermission(user_id::Integer, project_id::Integer, create_permission::Bool, read_permission::Bool, update_permission::Bool, delete_permission::Bool)::Tuple{Optional{<:Int64},UpsertResult}Create a UserPermission.
Arguments
user_id::Integer: The id of the user.project_id::Integer: The id of the project.create_permission::Bool: Whether the user has create permission.read_permission::Bool: Whether the user has read permission.update_permission::Bool: Whether the user has update permission.delete_permission::Bool: Whether the user has delete permission.
Returns
An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
DearDiary.update_userpermission — Functionupdate_userpermission(id::Integer, create_permission::Optional{Bool}, read_permission::Optional{Bool}, update_permission::Optional{Bool}, delete_permission::Optional{Bool})::UpsertResultUpdate a UserPermission.
Arguments
id::Integer: The id of the user permission to update.create_permission::Optional{Bool}: The new create permission.read_permission::Optional{Bool}: The new read permission.update_permission::Optional{Bool}: The new update permission.delete_permission::Optional{Bool}: The new delete permission.
Returns
An UpsertResult. Updated if the record was successfully updated (or no fields were changed), Unprocessable if the record violates a constraint or if no fields were provided to update, and Error if an error occurred while updating the record.
DearDiary.delete_userpermission — Functiondelete_userpermission(id::Integer)::BoolDelete a UserPermission.
Arguments
id::Integer: The id of the user permission to delete.
Returns
true if the record was successfully deleted, false otherwise.