This question has been flagged
1 Reply
4140 Views

Hello, Is there a way to give access rights for limited time in OpenERP? You can give let say sales manager rights, but it stays permanently as long as you don't take it a way. Is it possible to give such access rights for set time, for example 1 day and when 1 day passes, such rights will be taken back.

Avatar
Discard

You can make a cron job(Scheduler) of 1 day, and then you can make the user inactive as soon as the day passes. i.e field active=False in res.users

Author

Some times that user needs to be active if it works in a company. That user just gets access to some resources for limited time. When that access will be taken away, he will still have his old access were he could previously see other resources.

Alright, I got your point. Then you can make a boolean fields for that user(res.user form) for the respective records you want him to show, and as soon as the it hits the save button, Two things:1.Make the respective record rule field 'active' = True and 2. Cron job gets activate that will run after 1 day(or whatever time you want) to make record rule field 'active' = False.

Author

That would be the case for one user. But if same rule would use different people at the same time. Let say one get access with that rule for one day, another for two. So after one day that rule would become inactive and second user would not have access too. I think this needs to work in assigning/unassinging rule/group level.

You in the above Question description asked about the single user 'sale manager', otherwise yes you are right you can do the same functionality for the multiple people using group, and you can even add the user the group using python code, rather than doing that manually.I hope it helps you achieving what you want.

Author

Thanks for Ideas I think now I'll be on track implementing this feature.

Best Answer

I think its wise to accept the answer if you got what you were looking for Mr.Andrius.

Avatar
Discard