Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to add role to the other users #4

Open
mostafabarmshory opened this issue Jan 3, 2018 · 2 comments
Open

Fail to add role to the other users #4

mostafabarmshory opened this issue Jan 3, 2018 · 2 comments

Comments

@mostafabarmshory
Copy link
Member

Here is error detail:

Request URL:http://localhost:9001/api/user/2/role/new
Request Method:POST
Status Code:500 Internal Server Error
Remote Address:127.0.0.1:9001
Referrer Policy:no-referrer-when-downgrade
Response Headers
view source
connection:close
content-length:3075
content-type:application/json; charset=utf-8
date:Wed, 03 Jan 2018 08:25:30 GMT
server:Apache
x-powered-by:Pluf (Phoenix Scholars Co.) - http://dpq.co.ir
Request Headers
view source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.9
Cache-Control:no-cache
Connection:keep-alive
Content-Length:14
Content-Type:application/x-www-form-urlencoded
Cookie:JSESSIONID=node0q4ypbxctjv4d1v8civhax7myv2.node0; sessionid=YToxOntzOjE2OiJQbHVmX1Nlc3Npb25fa2V5IjtzOjMyOiI2ODcxYTEzOWVhNTIxNjE1ZjllYzA2MTQ1YzQyZGE3ZSI7fQ%3D%3D49a0fce5a4dcc445b07888be98af1661
Host:localhost:9001
Origin:http://localhost:9001
Pragma:no-cache
Referer:http://localhost:9001/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Form Data
view source
view URL encoded
id:3
role_id:3
@hadimansouri
Copy link
Member

@mostafabamshory
I think your request param is not appropriate. Here is description of API to add new role to an user:

POST: /api/user/{userId}/role/new
params: role (id of role to be added to user)

@mostafabarmshory
Copy link
Member Author

Same error on digidoki:


Notice: Undefined index: role in /home/psimorgh/public_html/vendor/pluf/user/src/User/Views/Permission.php on line 72

Fatal error: Uncaught exception 'PlufErrorHandlerException' with message 'Cannot modify header information - headers already sent by (output started at /home/psimorgh/public_html/vendor/pluf/user/src/User/Views/Permission.php:72)' in /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/HTTP/Response.php:154 Stack trace: #0 [internal function]: PlufErrorHandler(2, 'Cannot modify h...', '/home/psimorgh/...', 154, Array) #1 /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/HTTP/Response.php(154): header('HTTP/1.0 404 NO...', true, 404) #2 /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/HTTP/Response.php(140): Pluf_HTTP_Response->outputHeaders() #3 /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/Dispatcher.php(302): Pluf_HTTP_Response->render(true) #4 /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/Dispatcher.php(90): Pluf_Dispatcher::handleResponse(Object(Pluf_HTTP_Request), Object(Pluf_HTTP_Response_ServerError)) #5 /home/psimorgh/public_html/index.php(36): Pluf_Dispatcher::dispatch('api/user/14/rol...', ' in /home/psimorgh/public_html/vendor/pluf/core/src/Pluf/HTTP/Response.php on line 154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants