Skip to content
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

Remember and apply default ACL settings to records #96

Open
cheungpat opened this issue Apr 28, 2017 · 1 comment
Open

Remember and apply default ACL settings to records #96

cheungpat opened this issue Apr 28, 2017 · 1 comment

Comments

@cheungpat
Copy link
Contributor

cheungpat commented Apr 28, 2017

When calling -[SKYContainer defineDefaultAccessWithRecordType] the SDK should remember the settings and apply default ACL settings to record when needed (see below). The default ACL settings does not need to persist across application relaunch because it is expected that the developer will always call this method when the app launches.

The default ACL should not be applied to a record when it is instantiated. The default ACL should only apply when the the developer tries to mutate the record ACL.

Since -[SKYRecord accessControl] is readonly and nil when record is instantiated, it is not reasonable to expect the developer to change the record ACL using methods provided in SKYAccessControl. To make the iOS SDK to match the design of the JS/Android SDK, we should add -[SKYRecord set[Public](No|ReadOnly|Write)Access[For(User|Role)]] that implement record ACL mutation.

When default ACL for the record type is not defined, the fallback ACL will apply. The fallback ACL is public-readable.

If record ACL is null, getting the record ACL will not cause the record ACL to change. Return the default ACL or fallback ACL in this case.

Implement -[SKYRecord get[Public](No|ReadOnly|Write)Access[For(User|Role)]] for getting record ACL.

In earlier versions of the SDK, +[SKYAccessControl (set|get)DefaultAccessControl] sets and gets the default ACL that applies to all record types. These methods should be retained but deprecated. These methods should alter the fallback ACL. In other words, calling these methods will override the fallback ACL of public-readable.

@cheungpat
Copy link
Contributor Author

I recommend that you don’t make SKYAccessControl/SKYRecord calls SKYContainer for getting the default ACL / fallback ACL.

@cheungpat cheungpat changed the title acl: Remember and apply default ACL settings to records Remember and apply default ACL settings to records Apr 28, 2017
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

No branches or pull requests

1 participant