0

I am working on symfony project. Project is for posting job , and hiring employees.

I have created Admin and front end successfully.

Now what I want is to add multiple user in front end. I have 4 different type of users in front end.

Job Seeker (Candidate looking for new job)

Employees ( who post a job and hiring job seeker candidate)

Premium Employees ( who post a job and hiring job seeker candidate and have some more functionality then Employees )

Guest ( who can only see all the job seeker , Employees , Preminum Employees post )

I just need flow of this functionality after that I will implement all this myself.

So how can I implement this Functionality in Front end ?

7
  • Not sure about your question. With front and back do you mind separated machines talking to each other by some API? Are you using (or planing to use) roles? Commented Sep 12, 2016 at 12:10
  • @Carlos I am creating symfony website so don't need to use any API.what I want is I want to create 3 different type of users and want to give them access of front end as per role. I am using FOSUserBundle. For Ex: if you are candidate user then you can't get access of "POST A JOB" section because only employees can post job and so on for other user roles. Commented Sep 13, 2016 at 5:28
  • If you are using fosuserbundle you can use the built in roles system. You have to check the granted roles on each controller function and decide to allow or not the user to do the action. A user can have more than one role, or you can define a hierarchy en security.yml so higher level roles automatically includes some or every low level roles. Commented Sep 13, 2016 at 5:42
  • @Carlos so I need to set permission for user in controller action ?Right? Commented Sep 13, 2016 at 5:57
  • You can define urls with a required role in security.yml you can also check roles at controller function level to have more fine grained control. But you have to assign roles during the user creation process or in the admin area or somewhere else not in the protected controllers. Commented Sep 13, 2016 at 6:06

1 Answer 1

1

I think according to what you try to do. You could give a try to pugx. You will probably have to change your actual User but it could help you a lot.

PUGXMultiUserBundle

An other way would be to have one user Entity with many ROLE corresponding to what your user can do or not.

see Symfony Authorization documentation on the matter

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.