Urgent: I changed permissions and now can't view dashboard pages

Permalink
I created two groups, added one user to each, and from there went on to assign permissions globally from the homepage (parent) to all the other webpages(children). For some I manually configured access rather than inherited.

Now I don't know what I did but all of a sudden I can no longer view the system settings page, or sitemap to adjust permissions.

Is there a way to reset all to defaults? Have I just shot myself in the foot? I need this site ready for tomorrow and now this!

Help!

webnut
 
webnut replied on at Permalink Reply
webnut
oh, and now when I log out, or return to website, the edit dashboard still displays minus the edit and logo.
webnut replied on at Permalink Reply
webnut
And I can't even log out...???
I've cleared my browser cache, but each time I go to the dashboard it logs me in without authentication V.V

Bah!

So I can't even log in with the default admin account. >.>
webnut replied on at Permalink Reply
webnut
it appears as though I've given guest access to the dashboard...?
Not sure how, as I didn't change any guest settings. I did however add two accounts and proceeded to give them permissions, but nothing the admin didn't already have?? So this is pretty weird, it's like the permissions don't work intuitively in C5 the way you would expect.

As of right now, dashboard is open. I can't get to the login page because im redirected to the dashboard. And this website is supposed to go live tomorrow. >.>

Wow. Absolutely... Wow.
juliandale replied on at Permalink Best Answer Reply
juliandale
Try running this code on the site (or something along those lines):

Loader::model('page_list');
$pl = new PageList();
$pl->ignorePermissions();
$pl->includeSystemPages();
$pages = $pl->get($itemsToGet = 100, $offset = 0);
$allPagePermissionKeys = PermissionKey::getList('page');
$allPagePermissionKeyHandles = array_map(function($permissionKey) {
 return $permissionKey->getPermissionKeyHandle();
}, $allPagePermissionKeys);
foreach($pages as $page){
  $page->clearPagePermissions(); // reset to nothing
  $page->setPermissionsToManualOverride();
  // Add permission for the Administrators group to do EVERYTHING
  $page->assignPermissions(Group::getByName('Administrators'), $allPagePermissionKeyHandles);
}

Hopefully that'll reset all pages to give the Administrators user group full access to do what they want.
webnut replied on at Permalink Reply
webnut
thank you.
Should I be placing this file somewhere specific?

I get a class loader error:
Fatal error: Class 'Loader' not found in permissions_reset.php on line 1
juliandale replied on at Permalink Reply
juliandale
Just stick it in your main theme home.php file, as you should only need to run it once. The script needs the Concrete side of things hooked up, which is likely why it gave an error.
webnut replied on at Permalink Reply
webnut
can I just delete the permissions file via ftp?
webnut replied on at Permalink Reply
webnut
course I don't know where it is ... they're probably stored in the DB....which I can't view. >.<
webnut replied on at Permalink Reply
webnut
im looking at the table: FileSetPermissionAssignments
Is this the table I need to adjust?
webnut replied on at Permalink Reply
webnut
Well, looks like I'm going for a back up restore.
$40 USD, but I've wasted too much time on this already and it appears
C5 has no built in RESET function, such that you can't even upload the backup because you can't access it. >.>

Really weird that the admin account was locked out. Anyway.