Question

Photo of Dillan Cagnetta

0

Security by campus

Hi everyone 

I'd like implement security by campus .so that the logged in user may only view people in their campus

I understand every entity has an IsAuthorized method. 

would I need to extend this method in the Person model to check the logged in persons campus ?

Am I on the right track?

Any help is much appreciated

 

 

  • Photo of David Leigh

    0

    Hi Dillan,

    We have run into similar challenges with context-aware security when creating our external site.
    I have added an enhancement request on GitHub to propose a solution to this problem - please have a look and add your thoughts:
    https://github.com/SparkDevNetwork/Rock/issues/1548

    To answer your question though:
    Yes, the Person.IsAuthorized method is what you would need to modify to implement security for the current Campus.
    For a  good example of implementing this method, see the Group.IsAuthorized method, which modifies this method to grant access to a Group if the current user is a Leader of the Group.