how to invite same user multiple times using devise invitable - ruby-on-rails

I am working with devise invitable gem with rails 3.2 application . My problem is that
I have a user who involves in several groups , so group owner will send invitation to that user . Now I want to implement the functionality to send invitation for the same user from different groups , but devise invitable not allows me to do that ..
Can anyone help me .. thanks in advance ..

Devise is an authentication framework. Authentication only handles identifying who somebody is.
If you have a system where a user can get invited to multiple groups, then this is no longer authentication. Instead you need an authorization layer to manage what sort of access each user has.
You would still use Devise to log users into and out of your system but you need to use something like CanCan in order to implement this sort of access control.

Related

How to check if user exists before inscription with devise rails 5?

I m using devise for registration user, but my way it is a little diffrente, how ?
the user can sign up juste when another user give him his ID
so the new user need to verifie the ID before continue
how can i do it ?
If you are using devise,then a better approach is to use the devise_invitable gem,with this,you can send invitations to users directly to their mailbox and also have access to who invited a particular user and lots of other stuffs.

Switching from Devise to OmniAuth with Rails 5. Keeping Devise or not?

So I have been using Devise gem for users to sign up with email, but now I want to switch to Twitter login using OmniAuth gem. I'm a bit confused with the transition.
Should I still keep Devise Gem or remove it completely and create a custom User table to store users' personal and Twitter details?
Thank you tons!
No you can use Devise Omniauthable option. check the instructions here. You will not have to separate users in different tables, just follow the instructions to add twitter sign on and add the appropriate fields to your users table(provider and uid)

Devise confirmation email always to the admin

I'm building a system using Devise as the gem responsible for handling users.
What I'm looking for it's a way to send the confirmation email always to the same email(it would be the admin), so that he can choose if the person should, or not, be allowed into the system.
You can refer to this How To to let admin confirm the user before signin, you probably won't need comfirmable module.

Devise two step confirmation

a have a client with a website built on RoR by other developer, the website uses devise for user authentication and registration.
The website allows users to registrate and then send them a confirmation email, when they confirm their email, then they can login, BUT they can't see the content until they are approved to see it.
My client ask me to don't allow users to login until two things happen: They confirm their email and him(my client) approve them to see the content.
I tried this adding active_for_authentication? to the user model and returning true or false deppending if they are approved or not, but like the documentation of devise saids: the method active_for_authentication? is overriden by other modules like confirmable.
How can i perform this two validation using devise?
thanks for your help
You have to add authorization control in your application.
So I advice you to use CanCan gem it's easy to set and it allows you to define access rules based on your criteria.

Register a User half way with Devise

Due to the requirements of my app, I need the ability to create Users server-side using only their email addresses. This acts as a sort of invitation when a friend of theirs adds them to a group when they dont have an account yet. I'll be sending the invited user an email to notify them, containing a link where they can "create" their account. I'd like to know if Devise has any built in support for scenarios like this. If not, how would you go about doing it?
A member of #devise recommended the following gem:
https://github.com/scambra/devise_invitable
Seems to be exactly what I was looking for.

Resources