Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
hi all i want to solve my problem i need to download a minimal projet and if i bundle them i have a mistake saying. Le mercredi 19 juillet 2017

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
Hi in my item view i want to know how to add item using the user id who connected in my app i doo link user to item Le mercredi 19 juillet 2017 21:45:53 UTC-4, babacar thiam a écrit : > > Yeah i see and then if i wan t to load data at item html.erb i have a > problem for my user id because i

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
Yeah i see and then if i wan t to load data at item html.erb i have a problem for my user id because i have a link to user and item in item table. Le mercredi 19 juillet 2017 21:26:01 UTC-4, David Gleba a écrit : > > Do this in your project folder at command prompt. > > > rails generate

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread David Gleba
Do this in your project folder at command prompt. rails generate scaffold User2 email:string encrypted_password:string reset_password_token:string reset_password_sent_at:datetime remember_created_at:datetime sign_in_count:integer current_sign_in_at:datetime last_sign_in_at:datetime

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
Yeah its my blem to create this. Cause for me i have a view user and if i want to creer or edit new view i havent role my collection select is empty. MAy i import your view user2 for me ? Le mercredi 19 juillet 2017 21:06:35 UTC-4, David Gleba a écrit : > > > I added user2 to

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread David Gleba
I added user2 to https://github.com/dgleba/brail347a22 -- You received this message because

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
I say that i have a mistake if i want to create new user or new role or new item in the html.erb. And if i use seed.rb i succeeded. 2. Devise/cancancan i think that its interesting so i look for other alternative for cancancan. Le mercredi 19 juillet 2017 19:59:42 UTC-4, David Gleba a écrit : >

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread David Gleba
1: So, are you saying you have succeeded with: 'i see the problem was solved. In a simple example if i add user or item or role at the seed.rb file it run normally and me i need to add user or item in the html.erb file? ' 2: It is your choice. Devise/cancancan or strongbolt. I have not looked

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread babacar thiam
I see your git i check this 2 item and i import your implementation for testing. for the first step my friend say me to use this git https://github.com/605data/strongbolt_example and for me i have this information for your git brail. You suggest me the strong bolt guide or your example. For the

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread David Gleba
For your second item: I suggest that you download this: https://github.com/dgleba/brail347a22 - cp config/database-example.ymlconfig/database.yml - cp config/application-example.yml config/application.yml - cp config/secrets-example.yml config/secrets.yml - -

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread 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 )

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread David Gleba
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

Re: [Rails] Re: RBAC_CANCAN

2017-07-19 Thread Colin Law
On 19 July 2017 at 00:07, babacar thiam 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread 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,

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread 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 > wrote: > >

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread Colin Law
On 18 July 2017 at 22:02, babacar thiam 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 ==

Re: [Rails] Re: RBAC_CANCAN

2017-07-18 Thread 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-17 Thread babacar thiam
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

Re: [Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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

Re: [Rails] Re: RBAC_CANCAN

2017-07-17 Thread d 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

[Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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

[Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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

[Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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

[Rails] Re: RBAC_CANCAN

2017-07-17 Thread 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: > https://github.com/dgleba/bashrail there are scripts for this. Even if > you

[Rails] Re: RBAC_CANCAN

2017-07-14 Thread 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: