This repository was archived by the owner on Oct 23, 2020. It is now read-only.
File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 6
6
</header >
7
7
8
8
<section style =" display : flex ; padding : 10px " >
9
- <button @click =" $acl.change('admin' )" >Turn admin</button >
10
- <button @click =" $acl.change('public ')" >Turn public</button >
9
+ <button @click =" $acl.change(['read', 'write'] )" >Turn admin</button >
10
+ <button @click =" $acl.change('read ')" >Turn public</button >
11
11
</section >
12
12
13
13
<p style =" padding : 10px " >Current permission: {{ $acl.get }}</p >
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ Vue.use(AclInstaller)
7
7
const timeout = ms => new Promise ( resolve => setTimeout ( resolve , ms ) )
8
8
9
9
export default new AclCreate ( {
10
- initial : 'public ' ,
10
+ initial : 'read ' ,
11
11
notfound : {
12
12
path : '/error'
13
13
} ,
14
14
router,
15
15
acceptLocalRules : true ,
16
16
globalRules : {
17
- isAdmin : new AclRule ( 'admin ' ) . generate ( ) ,
18
- isPublic : new AclRule ( 'public' ) . or ( 'admin ') . generate ( )
17
+ isAdmin : new AclRule ( 'read' ) . and ( 'write ') . generate ( ) ,
18
+ isPublic : new AclRule ( 'read ' ) . generate ( )
19
19
}
20
20
} )
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export default new Router({
23
23
name : 'admin' ,
24
24
component : Admin ,
25
25
meta : {
26
- rule : new AclRule ( 'admin ' ) . generate ( )
26
+ rule : new AclRule ( 'write ' ) . generate ( )
27
27
}
28
28
} ,
29
29
{
You can’t perform that action at this time.
0 commit comments