User Permission

DearDiary.create_userpermissionFunction
create_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.

source
DearDiary.update_userpermissionFunction
update_userpermission(id::Integer, create_permission::Optional{Bool}, read_permission::Optional{Bool}, update_permission::Optional{Bool}, delete_permission::Optional{Bool})::UpsertResult

Update 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.

source