8000 Add permission support for workbook by sluenenglish · Pull Request #460 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Add permission support for workbook #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sluenenglish
Copy link
@sluenenglish sluenenglish commented Jul 15, 2019

I have taken the work that @DepthDeluxe did in #292 and tried to implement most of the suggestions left in the code review, as well as adding some more tests.

I've restricted the scope to workbooks as suggested in #292 for ease of review. I will add the support for projects and datasources once I've gotten some feedback.

Here is a sample usage:

server.workbooks.populate_permissions(wb)
print(wb.permissions)

permisssion_collection = TSC.PermissionsCollection(
    [
        TSC.PermissionsRule(
            TSC.PermissionsGrantee(TSC.Permission.GranteeType.Group, "<group-id>"),
            {
                TSC.Permission.WorkbookCapabilityType.AddComment: TSC.Permission.CapabilityMode.Deny
            },
        ),
        TSC.PermissionsRule(
            TSC.PermissionsGrantee(TSC.Permission.GranteeType.User, "<user-id>"),
            {
                TSC.Permission.WorkbookCapabilityType.AddComment: TSC.Permission.CapabilityMode.Deny
            },
        ),
    ]
)

server.workbooks.delete_permission(wb, permisssion_collection)

server.workbooks.update_permission(wb, permisssion_collection)

@t8y8
Copy link
Collaborator
t8y8 commented Jul 15, 2019

Thank you for the PR!

I have another MR in progress that changes the design a bit, and covers support for workbooks (#429) that would supersede this.

I'd appreciate your review or thoughts/concerns on the design changes; but 429 covers all the new types coming soon to Server, and plays with some of the existing patterns well.

@sluenenglish
Copy link
Author

Thanks for your response @t8y8

Sorry, I didn't see that PR. Not a problem, I will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0