Skip to content

Conversation

@rtdany10
Copy link
Contributor

@rtdany10 rtdany10 commented Jun 24, 2024

image

Role Replication allows users to easily replicate/extend role based access.

Often, we might have to give access to a user which is very similar to an existing role but with slight variation. For example, a purchase executive might not need all the access granted to Purchase User role. In such cases, we have to create a new role and then assign the access to each doctype individually via Role Permission Manager. This is hectic and takes a lot of time.

For example, to create a role that would have access to create a Purchase Order, you will need to grant access to:

  • Supplier
  • Company
  • Purchase Taxes and Charges Template
  • Payment Terms
  • Payment Terms Template
  • Accounts
  • Buying Settings

and the list goes on, based on the link fields you have in the doctype and code based dependency, fetch from etc.

On the contrary, it is easier to have a another role with same access as Purchase User and then strip it down based on use case. Role Replication allows you to replicate the role with it's access rights.

@federicocalvo
Copy link

@rtdany10 i waited 10 years for this function haha! excellent!

@barredterra
Copy link
Collaborator

barredterra commented Jun 24, 2024

Could you add a more detailed description to the PR, along with some real world use cases?

If I understand the code correctly, this creates a new Role and Custom DocPerms with all permissions from the existing role? Maybe even add some explanation within the doctype.

@rtdany10
Copy link
Contributor Author

@federicocalvo got tired of creating user-based roles that was painstakingly similar to that of existing roles, ended up creating a quick functionality. :)

@barredterra sorry, I've updated the PR description. Yes, we can add a description in the doctype itself. I'll send a PR in the evening hopefully.

@stale

This comment was marked as outdated.

@stale stale bot added the inactive label Jul 9, 2024
@stale

This comment was marked as outdated.

@stale stale bot added the inactive label Jul 26, 2024
@stale

This comment has been minimized.

@stale stale bot added the inactive label Aug 10, 2024
@akhilnarang akhilnarang merged commit 5cd757c into frappe:develop Aug 20, 2024
@barredterra barredterra added the add-docs New feature should be have an entry in documentation to increase the discoverability label Aug 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

add-docs New feature should be have an entry in documentation to increase the discoverability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants