/    Sign up×
Community /Pin to ProfileBookmark

View Pages based on permissions

Hi. Please help !!!
I need to create a website for internal (our office only) use and need to enable/disable some features or different views based on user’s permissions
And if, for example, I will add some new features/option to the website the users can see/use the newly added features/options based on their permissions as well.
How to create that kind of dynamic/flexible web page that will be showing/graying out features or links on the website based on users permisisons

Thank you and I hope you got the idea

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmDec 08.2015 — Use a login process that validates each user and assigns to them an access code(s) upon success. Assign a single access code to each page in your application and then compare the page's code to the code or codes that a user gets assigned to them after logging in. Store the codes as a comma-separated string in a session variable. When a page is loaded (or called for) retrieve the Session var using an explode to create an array of the codes and then use the in_array function to quickly determine if the user has permission to see the requested page. Same thing if you simply want to not place certain elements onto the html page that a script is outputting.

You could have multiple pages with the same code assigned to them for more generic pages and just one page with a specific code for the most strict pages. Administrators would assign user access codes. You could also have a super-code (for ex., 999) to give a user global access to any page by checking for that code as well as a page's single assigned code.

It's really a pretty simple thing - if you build the proper login process.
×

Success!

Help @ProgrammableME spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...