-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update sanctuary-scripts to version 1.5.0 #5
Conversation
@davidchambers could you lend a hand? This code example: Lines 67 to 94 in 5cd9614
...gets transformed to this for validation: // This defines a mapping from roles to permissions.
// We can use wildcards to assign multiple permissions at once.
var createVerifier = checkPermission({
'content-reader': ['content.read', 'images.read'],
'content-writer': ['content.write', 'images.upload'],
'superadmin': ['*']
});
;
// Let's say our user Bob is a content-reader, and also a content-writer.
var canBob = createVerifier(['content-reader', 'content-writer']);
;
// And Alice is an administrator.
var canAlice = createVerifier(['superadmin']);
;
// Bob has this permission through his content-reader role.
canBob('content.read');
true;
// Bob does not have this permission.
canBob('users.create');
false;
// Alice, however, does. She has all permissions (even the ones
// we haven't thought of yet).
canAlice('users.create')
true ...which causes linting errors for the Least clear to me is why the last statement doesn't have a semicolon. |
The interim fix is to disable these rules for |
I'm okay with that for now. I wanted to be sure I'm using transcribe correctly. I created sanctuary-js/sanctuary-scripts#14 as a reminder. |
5cd9614
to
3aecd39
Compare
@@ -40,7 +41,7 @@ assign both roles to that user. | |||
|
|||
## API | |||
|
|||
<h4 name="checkPermission"><code><a href="https://github.com/Avaq/permissionary/blob/v0.1.0/index.js#L49">checkPermission :: StrMap (Array String) -> Array String -> String -> Boolean</a></code></h4> | |||
#### <a name="checkPermission" href="https://github.com/Avaq/permissionary/blob/v0.0.0/index.js#L50">`checkPermission :: StrMap (Array String) -> Array String -> String -> Boolean`</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to the version number? 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh darn it.. I committed the README I was generating locally to identify the issue. I should be more careful and less hurried. I will push a fix to master
as if running sanctuary-release
. >.<
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'll just release a patch for consistency.
The leading |
I have a fix ready for the missing |
I just opened #11 to add the missing |
No description provided.