Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Add permissions for roles #88

Merged
merged 3 commits into from
Aug 19, 2020
Merged

Add permissions for roles #88

merged 3 commits into from
Aug 19, 2020

Conversation

kulmann
Copy link
Member

@kulmann kulmann commented Aug 19, 2020

We have default roles in ocis-settings and the respective bundle uuids are exposed there as constants. This PR adds permissions for the language to the default roles. We're not filtering for those, though, so this is only setting up the data basis for permission filtering later on.

@kulmann kulmann requested review from butonic, refs and PVince81 and removed request for butonic August 19, 2020 11:30
@kulmann kulmann self-assigned this Aug 19, 2020
if err != nil {
l.Err(err).Str("bundle", bundleID).Str("setting", permissionRequests[i].Setting.Id).Msg("Error adding setting to bundle")
} else {
l.Info().Str("bundle", bundleID).Str("setting", res.Setting.Id).Msg("Successfully added setting to bundle")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make that Debug ? otherwise the logs will get boring quickly... unless this is happening only once at the start of the service, in which case it's ok

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only happens once on service start.

Setting: &settings.Setting{
Id: "7d81f103-0488-4853-bce5-98dcce36d649",
Name: "language-create",
DisplayName: "Permission to set the language",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a way to translate those display names yet ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in the services. The displayname is shown in the UI and transifex is used on it, but since this is dynamically rendered, I'm sure that transifex is not able to pick those strings, yet. Needs investigation or some help from the transifex gods.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
Value: &settings.Setting_PermissionValue{
PermissionValue: &settings.Permission{
Operation: settings.Permission_OPERATION_CREATE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so setting the language is an act of creation ? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have CREATE and UPDATE as separate operations. There are permissions for both. CREATE on first request, UPDATE on subsequent requests. The operation is one of the two things I wanted to discuss with Jörn, both Alex and myself were not too happy with it so far... but still, this reflects our current iteration. 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for clarifying

do we have tickets to track the things I mentioned ?

@kulmann
Copy link
Member Author

kulmann commented Aug 19, 2020

👍 thanks for clarifying

do we have tickets to track the things I mentioned ?

Yes, now :-) thanks for reviewing and for your comments!

@ownclouders
Copy link

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- pkg/service/v0/settings.go  2
         

Clones added
============
- pkg/service/v0/settings.go  9
         

See the complete overview on Codacy

@sonarcloud
Copy link

sonarcloud bot commented Aug 19, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kulmann kulmann merged commit 731b23a into master Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants