RBAC_CANCAN

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RBAC_CANCAN

babacar thiam
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/28ea298b-1252-4ee0-a12e-5fadadbc8c4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
I use devise and cancancan for login and roles.

In my little rails app generator project: https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app, https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c13f1b34-b2f7-4cbf-ab20-14b94ef17100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e4af0768-00a0-490d-9f14-a7019ac07aae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ccb59872-b75a-4853-a95e-a60744b66947%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7ba57c2b-750b-450e-8393-11158cc00ba2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
The role_id is a column in the users table.

The role.rb model and the user.rb model are related.


In user.rb the roles are processed.

I find it is helpful to try to add the feature you want to a fresh plain test project.

When you can add it to a test project, then try to add it to your project.



On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <[hidden email]> wrote:
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app, https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAFNhzNbBW4VDOrT8sxW1WxRBMWtPXe-rDP1xFN6ZcKRQxGiFtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
Also, my implementation was patterned after this article.

https://hibbard.eu/authentication-with-devise-and-cancancan-in-rails-4-2/

Maybe that will help you also.

Can you post specific error messages, screen shots, code, etc? I may be able to answer specifically.



On Monday, July 17, 2017 at 11:29:07 PM UTC-4, David Gleba wrote:
The role_id is a column in the users table.

The role.rb model and the user.rb model are related.


In user.rb the roles are processed.

I find it is helpful to try to add the feature you want to a fresh plain test project.

When you can add it to a test project, then try to add it to your project.



On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <[hidden email]> wrote:
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



-- 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e1c7cb89-cfcc-4d54-b3f8-095fde886e05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
In reply to this post by David Gleba
yeah i see this moment i create a simple web app i use devise and cancancan
but i cant creer a select form to insert role id in the database for using html files devise/registrations.
In your github i dont undertand how to use its when i import then i have many thing aborted

Le lundi 17 juillet 2017 23:29:07 UTC-4, David Gleba a écrit :
The role_id is a column in the users table.

The role.rb model and the user.rb model are related.


In user.rb the roles are processed.

I find it is helpful to try to add the feature you want to a fresh plain test project.

When you can add it to a test project, then try to add it to your project.



On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HoqC6Hg2BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">thia...@...> wrote:
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HoqC6Hg2BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="HoqC6Hg2BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="HoqC6Hg2BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dgl...@...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0b5f79a3-1bdf-435a-ab46-1aa7ae5e6d78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
I go to create a teste app  using https://hibbard.eu/authentication-with-devise-and-cancancan-in-rails-4-2/ 
simple user project and role.
If it will run normally i could contact you else i i give you our mistake 

Le lundi 17 juillet 2017 23:41:50 UTC-4, babacar thiam a écrit :
yeah i see this moment i create a simple web app i use devise and cancancan
but i cant creer a select form to insert role id in the database for using html files devise/registrations.
In your github i dont undertand how to use its when i import then i have many thing aborted

Le lundi 17 juillet 2017 23:29:07 UTC-4, David Gleba a écrit :
The role_id is a column in the users table.

The role.rb model and the user.rb model are related.


In user.rb the roles are processed.

I find it is helpful to try to add the feature you want to a fresh plain test project.

When you can add it to a test project, then try to add it to your project.



On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <[hidden email]> wrote:
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f6577d48-f3f0-4712-8a2c-0488a1f64710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
hi i have a mistake since this morning .

undefined method `name' for nil:NilClass

Extracted source (around line #15):
13
14
15
16
17
18
              
end
def admin?
self.role.name == "Admin"
end
def seller?
self.role.name == "Seller"

Le mardi 18 juillet 2017 00:07:07 UTC-4, babacar thiam a écrit :
I go to create a teste app  using <a href="https://www.google.com/url?q=https%3A%2F%2Fhibbard.eu%2Fauthentication-with-devise-and-cancancan-in-rails-4-2%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH5XqBe4MjC0esD9OnE5NRxIfGgkg" rel="nofollow" style="color:rgb(209,72,54)" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhibbard.eu%2Fauthentication-with-devise-and-cancancan-in-rails-4-2%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH5XqBe4MjC0esD9OnE5NRxIfGgkg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhibbard.eu%2Fauthentication-with-devise-and-cancancan-in-rails-4-2%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH5XqBe4MjC0esD9OnE5NRxIfGgkg&#39;;return true;">https://hibbard.eu/authentication-with-devise-and-cancancan-in-rails-4-2/ 
simple user project and role.
If it will run normally i could contact you else i i give you our mistake 

Le lundi 17 juillet 2017 23:41:50 UTC-4, babacar thiam a écrit :
yeah i see this moment i create a simple web app i use devise and cancancan
but i cant creer a select form to insert role id in the database for using html files devise/registrations.
In your github i dont undertand how to use its when i import then i have many thing aborted

Le lundi 17 juillet 2017 23:29:07 UTC-4, David Gleba a écrit :
The role_id is a column in the users table.

The role.rb model and the user.rb model are related.


In user.rb the roles are processed.

I find it is helpful to try to add the feature you want to a fresh plain test project.

When you can add it to a test project, then try to add it to your project.



On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <[hidden email]> wrote:
I use mac os x.
I want to use your app to see specifically how use Rbac in a simple app.
And in my app i don't undertand how to link user to a specifique role.
in devise/ folder i can't see an in the form how to add role id 
and if i want to add user in the seed file i have a error.

Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
What operating system are you using?

Can you download the bashrail project to your PC and follow the instructions in the README.md. 

I wonder if you can run it as it is and see if it generates a rails app you can run. Then we can break it down into smaller pieces and try to understand what it is doing.


On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
i want to use your script to test how implement robe based access control .
I hav a problems to import this or to add some file  in my projet.
I can't see the views who create user our assign a role to a user its my matter.
help need if i could have our contact to communicate fastly.
need u david Dleba 

Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
i look our script AND I COME WITH U IF I HAVE NEW
Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
I use devise and cancancan for login and roles.

In my little rails app generator project: <a href="https://github.com/dgleba/bashrail" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNUqqxmlMrAnHeDDhN0Sm_ooe61Q&#39;;return true;">https://github.com/dgleba/bashrail  there are scripts for this. Even if you don't use the scripts, they document exactly how to implement it in that case.

look at:  
<a href="https://github.com/dgleba/bashrail/blob/master/devise1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fdevise1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwiX-nv56tiC3K1xeWOf2o2UfXEA&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/devise1.sh
<a href="https://github.com/dgleba/bashrail/blob/master/cancan1.sh" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbashrail%2Fblob%2Fmaster%2Fcancan1.sh\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFfOhAS5SYDJm1TCxilErDCTcXQ0w&#39;;return true;">https://github.com/dgleba/bashrail/blob/master/cancan1.sh

When I am learning something like this I strip the scripts down to just what is needed to create an app with the feature I am studing.

This app,<a href="https://github.com/dgleba/brail351d" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdgleba%2Fbrail351d\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE0NxU32jSSYix5unnljmw6wOGfOg&#39;;return true;"> https://github.com/dgleba/brail351d, was generated by bashrail and has fully functional roles like mention in your question.

David


On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
Hello guys i want to implement rbac autorisation for a rails app.
i use devise to generate user and i have a product controllers.
am a beginners at rails and i want to use:
user role show 
admin role edit
speruser role delete
I don't know how to implement this i use cancan and i have a problem to affect a role to a user

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/83dbd203-e1d8-44c2-b0b9-1d84db5cce90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

Colin Law
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   self.role.name == "Admin"
> end
> def seller?
>   self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvmToy1bLObRc8JQ5hiUz%3D00xaGLesq3Y1-oDa4ub7Ung%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="tfxFKZFFBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">thia...@...> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e7a9e5c3-d026-495e-914d-fa26bcf39f8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9969800f-4025-4f36-84d9-7219a57b28d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
The article has an app in github.

https://github.com/jameshibbard/authentication-with-devise-and-cancancan

Can you download it and run it successfully?



On Tuesday, July 18, 2017 at 10:28:33 PM UTC-4, David Gleba wrote:
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/728ff39c-a7ef-4b22-902e-6c9cc85a67cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
yeah in this i want to know how do to insert a new users using user view or devise and respected role.
in my userscontroller if i put at the top: before_filter :authentificate_user i hav and error saying 
use before_action 


Le mardi 18 juillet 2017 22:47:12 UTC-4, David Gleba a écrit :
The article has an app in github.

<a href="https://github.com/jameshibbard/authentication-with-devise-and-cancancan" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;">https://github.com/jameshibbard/authentication-with-devise-and-cancancan

Can you download it and run it successfully?



On Tuesday, July 18, 2017 at 10:28:33 PM UTC-4, David Gleba wrote:
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/03b6a44f-a9b5-4c86-82b3-bfaca6fcd95c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

Colin Law
In reply to this post by babacar thiam
On 19 July 2017 at 00:07, babacar thiam <[hidden email]> wrote:
> the error says no MethodError (undefined method `name' for nil:NilClass):

Exactly. The error says you have tried to call method 'name' on
something that is nil. You are calling method 'name' on self.role (you
have used self.role.name) therefore the error is saying that self.role
is nil.

Colin

>
>
>
> app/models/user.rb:15:in `admin?'
>
> app/models/ability.rb:7:in `initialize'
>
>
> Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
>>
>> On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>> >
>> > hi i have a mistake since this morning .
>> >
>> > undefined method `name' for nil:NilClass
>> >
>> > Extracted source (around line #15):
>>
>> >
>> > end
>> > def admin?
>> >   self.role.name == "Admin"
>> > end
>> > def seller?
>> >   self.role.name == "Seller"
>> >
>>
>> As the error says, self.role is nil
>>
>> Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/e7a9e5c3-d026-495e-914d-fa26bcf39f8a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsAKajSL3dB0sVEGB5ezqAPwRHyzig9cZRg_DbTJKH0pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
In reply to this post by babacar thiam
I may not be answering your question on this one, but I just an admin tool to add a user since the administrator of the system must grant the proper role to the new user. 
So, if am using rails_admin with the project, add the user in that tool and assign the appropriate role_id.

The code can also be setup so a user can sign-up them selves and a default role is assigned.

You can also add a user with a tool such as phpmyadmin, pgadmin, sqlite-browser like http://sqlitebrowser.org/.


On Wednesday, July 19, 2017 at 12:06:09 AM UTC-4, babacar thiam wrote:
yeah in this i want to know how do to insert a new users using user view or devise and respected role.
in my userscontroller if i put at the top: before_filter :authentificate_user i hav and error saying 
use before_action 


Le mardi 18 juillet 2017 22:47:12 UTC-4, David Gleba a écrit :
The article has an app in github.

<a href="https://github.com/jameshibbard/authentication-with-devise-and-cancancan" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;">https://github.com/jameshibbard/authentication-with-devise-and-cancancan

Can you download it and run it successfully?



On Tuesday, July 18, 2017 at 10:28:33 PM UTC-4, David Gleba wrote:
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/16d23649-4d46-4002-b6be-23f866b06a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

babacar thiam
yeah its great david i havent problem if i had a user in my seed file (for example) and then i need to add new role new user or new item for my html.erb file and i don't know how i do to link user and item if i add item example.
Second wan't to know if its possible to use your projet (david ) to verify something for my user role and admin 
(need to import new projet and doing test for this) 

Le mercredi 19 juillet 2017 06:47:20 UTC-4, David Gleba a écrit :
I may not be answering your question on this one, but I just an admin tool to add a user since the administrator of the system must grant the proper role to the new user. 
So, if am using rails_admin with the project, add the user in that tool and assign the appropriate role_id.

The code can also be setup so a user can sign-up them selves and a default role is assigned.

You can also add a user with a tool such as phpmyadmin, pgadmin, sqlite-browser like <a href="http://sqlitebrowser.org/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsqlitebrowser.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEixp9LtmBHnjcEzaiXKshYr_BOZA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsqlitebrowser.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEixp9LtmBHnjcEzaiXKshYr_BOZA&#39;;return true;">http://sqlitebrowser.org/.


On Wednesday, July 19, 2017 at 12:06:09 AM UTC-4, babacar thiam wrote:
yeah in this i want to know how do to insert a new users using user view or devise and respected role.
in my userscontroller if i put at the top: before_filter :authentificate_user i hav and error saying 
use before_action 


Le mardi 18 juillet 2017 22:47:12 UTC-4, David Gleba a écrit :
The article has an app in github.

<a href="https://github.com/jameshibbard/authentication-with-devise-and-cancancan" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;">https://github.com/jameshibbard/authentication-with-devise-and-cancancan

Can you download it and run it successfully?



On Tuesday, July 18, 2017 at 10:28:33 PM UTC-4, David Gleba wrote:
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4bd877cf-01f8-4a99-9fde-c36b80cc7078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RBAC_CANCAN

David Gleba
For your second item:

I suggest that you download this:  https://github.com/dgleba/brail347a22

  • cp  config/database-example.yml    config/database.yml   
  • cp  config/application-example.yml config/application.yml
  • cp  config/secrets-example.yml     config/secrets.yml    

  • Check db/../..seeds*.rb for username and password.
  • bundle
  • rails s
It was recently created by bashrail.


For your first item: 
If am answering your question, I would scaffold User2 to match the User resource.
Then, change the table name in user2.rb to the user table.

Like so,  
self.table_name = 'users'

This will allow you to edit the users table from user2/ url.

I will add this to bashrail when I get a chance.





On Wednesday, July 19, 2017 at 2:47:20 PM UTC-4, babacar thiam wrote:
yeah its great david i havent problem if i had a user in my seed file (for example) and then i need to add new role new user or new item for my html.erb file and i don't know how i do to link user and item if i add item example.
Second wan't to know if its possible to use your projet (david ) to verify something for my user role and admin 
(need to import new projet and doing test for this) 

Le mercredi 19 juillet 2017 06:47:20 UTC-4, David Gleba a écrit :
I may not be answering your question on this one, but I just an admin tool to add a user since the administrator of the system must grant the proper role to the new user. 
So, if am using rails_admin with the project, add the user in that tool and assign the appropriate role_id.

The code can also be setup so a user can sign-up them selves and a default role is assigned.

You can also add a user with a tool such as phpmyadmin, pgadmin, sqlite-browser like <a href="http://sqlitebrowser.org/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsqlitebrowser.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEixp9LtmBHnjcEzaiXKshYr_BOZA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsqlitebrowser.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEixp9LtmBHnjcEzaiXKshYr_BOZA&#39;;return true;">http://sqlitebrowser.org/.


On Wednesday, July 19, 2017 at 12:06:09 AM UTC-4, babacar thiam wrote:
yeah in this i want to know how do to insert a new users using user view or devise and respected role.
in my userscontroller if i put at the top: before_filter :authentificate_user i hav and error saying 
use before_action 


Le mardi 18 juillet 2017 22:47:12 UTC-4, David Gleba a écrit :
The article has an app in github.

<a href="https://github.com/jameshibbard/authentication-with-devise-and-cancancan" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjameshibbard%2Fauthentication-with-devise-and-cancancan\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHZvCwsnj_HJXmUrNFIszzpGyEPuA&#39;;return true;">https://github.com/jameshibbard/authentication-with-devise-and-cancancan

Can you download it and run it successfully?



On Tuesday, July 18, 2017 at 10:28:33 PM UTC-4, David Gleba wrote:
I see that in one spot you have Admin - capitalized. and in another it is not capitalized - admin.

I wonder if capitalization matters in your code.

Note that we can't see your code.  That makes it harder to help you when we can't see the code.


On Tuesday, July 18, 2017 at 7:07:11 PM UTC-4, babacar thiam wrote:
the error says no MethodError (undefined method `name' for nil:NilClass):

  

app/models/user.rb:15:in `admin?'

app/models/ability.rb:7:in `initialize'


Le mardi 18 juillet 2017 17:15:51 UTC-4, Colin Law a écrit :
On 18 July 2017 at 22:02, babacar thiam <[hidden email]> wrote:
>
> hi i have a mistake since this morning .
>
> undefined method `name' for nil:NilClass
>
> Extracted source (around line #15):

>
> end
> def admin?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Admin"
> end
> def seller?
>   <a href="http://self.role.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fself.role.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0TDLJi1zuU04ldwaDUpT1ROBVng&#39;;return true;">self.role.name == "Seller"
>

As the error says, self.role is nil

Colin


 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0ba25db5-3c06-442d-9489-e28313d0521f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
12
Loading...