Closed dbd5 closed 9 years ago
Hello, you not connected authManager.
I think it is logical, if you are using RBAC :hatched_chick:
Thanks - my fault, I've taken care of that, now the form is open but it doesn't save. This is the procedure I've followed;
Any suggestion what could be wrong?
The structure of the RBAC tables are standard but its possible other extensions have modified the User table. Currently it is;
CREATE TABLE user
(
id
INT(11) NOT NULL AUTO_INCREMENT,
username
VARCHAR(25) NOT NULL COLLATE 'utf8_unicode_ci',
email
VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
password_hash
VARCHAR(60) NOT NULL COLLATE 'utf8_unicode_ci',
auth_key
VARCHAR(32) NOT NULL COLLATE 'utf8_unicode_ci',
confirmed_at
INT(11) NULL DEFAULT NULL,
unconfirmed_email
VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
blocked_at
INT(11) NULL DEFAULT NULL,
registration_ip
VARCHAR(45) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
created_at
INT(11) NOT NULL,
updated_at
INT(11) NOT NULL,
status
SMALLINT(6) NOT NULL DEFAULT '10',
flags
INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (id
),
UNIQUE INDEX user_unique_username
(username
),
UNIQUE INDEX user_unique_email
(email
)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB
AUTO_INCREMENT=2
;
Regards,
Adam
Table user
doesn't participate.
Can you show authManager
config ?
Sure, here's a section of my /common/config/main.php; authManager is at the very end
Show me logs from debug tools when you clicked save
in browser
Name of Role is should be typed
Screen
Logs;
Has errors in console browser?
Not really, I don't see any errors at all. I'm totally surprised -- nothing happens when I click save.
But there's an error when I inspect element, The form is "A form to create-update-delete roles and permissions", see screenshot below;
Need more information about this error. Line? File?
Oh, it's no special file.
When you asked if there were errors on the console or browser, I did the following:
Then I saw that error.
Its the standard extension files. I have made no changes at all
Here it does not appear. https://basic-rbac-githubjeka.c9.io/basic/web/index.php?r=rbac
Need the name of the file where the error occurs.
App.js - see screenshot below
Please, open your rbac-gui page and enter json
in console. You should get.
P.S Do you work in Safari browser?
JSON.parse throws a SyntaxError exception if the string to parse is not valid JSON.
Please check what return from /index.php?r=rbac/default/items
url. Perhaps you have an php error .
The output is {"nodes":[],"links":[]}
Ok.
Add 'enableCsrfValidation'=>false,
to your global config:
//...
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '6oLSyFbXRvg8',
'enableCsrfValidation'=>false,
],
//...
And run in console :
curl --data "ItemForm%5Btype%5D=1&ItemForm%5BoldName%5D=&ItemForm%5Bname%5D=Users&ItemForm%5Bdescription%5D=Registered+users&ItemForm%5BruleName%5D=&ItemForm%5Bdata%5D=" https://YOUR_HOST/index.php?r=rbac/default/save-item
# should get {"oldName":"","name":"Users","type":"1","description":"Registered users","ruleName":null,"data":null}
Reload rbac-gui page and you should see your Role Users
I've made the changes to the global config but I'm not sure how to run the curl command, it's a DLL. I'm using Windows/XAMPP environment.
Regarding, "Reload rbac-gui page and you should see your Role Users"
It appears you are not clear with my situation, let me recap;
The definition of the problem is that I cannot add Roles to the system even though everything seems normal, I ran into this issue at the point where I want to add Roles etc
Thanks for your support and patience in this matter
When you click Save
that sent POST data to index.php?r=rbac/default/save-item
and returned model as string(json format). If you have JSON.parse SyntaxError exception then the string to parse is not valid JSON. Respectively you have php error instead model.
In my last commnet, I want you post data to index.php?r=rbac/default/save-item
and show me the error.
Hi Evgeniy,
I guess we can close this if it can't be independently verified
Adam
Hello,
I am getting this "Call to a member function getRules() on a non-object" when I go to http://admin.app.dev/rbac
Please have a look at my screen and advice what I could be doing wrong, I believe I have followed the instructions you provided.
Regards,
Adam