Commit a7bb8b98 authored by dragonwize's avatar dragonwize
Browse files

Only set default perms on core roles

parent 2835d06a
......@@ -62,14 +62,14 @@ function better_formats_install() {
// default perms to be like core defaults
$default_perms = ',show format selection,show format tips,collapsible format selection,collapse format fieldset by default';
// get current perms
$sql = "SELECT * FROM {permission}";
// get current core perms
$sql = "SELECT * FROM {permission} WHERE rid IN (1,2)";
$result = db_query($sql);
$row_perms = array();
while ($row = db_fetch_object($result)) {
$role_perms[] = $row;
}
// add perms to all roles
// add perms to core roles (anonymous user, authenticated user)
foreach ($role_perms as $perms) {
$sql = "UPDATE {permission} SET perm = '%s' WHERE pid = %d";
db_query($sql, $perms->perm . $default_perms, $perms->pid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment