magda-io / magda

A federated, open-source data catalog for all your big data and small data
https://magda.io
Apache License 2.0
496 stars 93 forks source link

Permission Constraint Exemption At Resource Level #3455

Closed t83714 closed 10 months ago

t83714 commented 1 year ago

Permission Constraint Exemption At Resource Level

Since v2, we have introduced a more complete authz model.

The model allows us to create permissions with 3 types of constraints:

Permission with constraints allows us to grant conditional access to some users/roles to achieve the fine-gain access control management from the admin side.

However, for many cases, the resource owner might want to nominate some resources to be exempted from those constraints as data custodians.

One use case would be:

Currently, if a data custodian needs to make a record public, he will have to set access-control.orgUnitId to empty. This might impact permission set at organisational unit levels. e.g. users who have permissions with organisational unit constraints within the previously set organisational unit will lose the access to the dataset.

Update 25th July 2023: we only need one allowExemption field to offer the exemption for all 3 current available constraints.

mwu2018 commented 1 year ago

@t83714 What will happen if allowExemption is set to false but access-control.constraintExemption is set to true?

t83714 commented 1 year ago

@t83714 What will happen if allowExemption is set to false but access-control.constraintExemption is set to true?

In this case, the permission would have NO access even access-control.constraintExemption is set to true.

So the idea is that:

mwu2018 commented 1 year ago

The above arrangement potentially could cause confusion at the UI level. I.e., a restricted dataset might not have a padlock icon attached to it.

t83714 commented 1 year ago

The above arrangement potentially could cause confusion at the UI level. I.e., a restricted dataset might not have a padlock icon attached to it.

I think if a dataset's access potential should be restricted at a certain level (constrained), the data custodian should never set constraintExemption to true, right?

If this case, the dataset would be considered as a "non-public" (restricted) dataset( and work as expected)?

I think the padlock feature refers to the DT project? If so, I think the constraintExemption field could be a great indicator field for that purpose.

In the DT project, I think people want to know which datasets are "non-public". But the term "non-public" is not an accurate description of the situation of the access scope -- a dataset might be accessible to many roles but still can be considered as "non-public". e.g. A dataset can be public (i.e. visible to the whole organisation) but the system owner might not want it to be visible to the general public (anonymous users)

In the DT project, I think the meaning of "non-public" is closer to the data custodian's view of access scope. i.e. datasets with padlock should be interpreted as:

mwu2018 commented 1 year ago

The padlock icon in the DT is to inform users if a dataset is public or not. If a dataset is only accessible to certain roles of users , a padlock should show up so that the user is aware of that there is constraint to this dataset. When the user tries to share the dataset, he knows users without those specific roles will not be able to see it.

t83714 commented 10 months ago

closed via PR: https://github.com/magda-io/magda/pull/3475