Orkun Posted October 23, 2015 Share Posted October 23, 2015 I want to set the pagestatus of a admin-page to hidden when a user is logged in which has the role "company". I did this in the admin.php but it doesn't work. What I am missing? if(wire('user')->isSuperuser()){ $pages->get(1265)->removeStatus(Page::statusHidden); } else{ $pages->get(1265)->addStatus(Page::statusHidden); } Link to comment Share on other sites More sharing options...
kongondo Posted October 23, 2015 Share Posted October 23, 2015 (edited) You are not saving the status you have just set. Assign your page 1265 to a variable, set a status to it and save. Hidden and similar flags are saved to the db (see the column status in the table pages in your PW db) so you need to save. Edited October 23, 2015 by kongondo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now