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

Cannot save permissions without the view option #531

Open
mrtrinhvn opened this issue May 25, 2020 · 4 comments
Open

Cannot save permissions without the view option #531

mrtrinhvn opened this issue May 25, 2020 · 4 comments
Assignees

Comments

@mrtrinhvn
Copy link

What steps will reproduce the problem?

In the admin, go to System => Group => A list of user group will be show. Point the mouse too the Three dots at the end of a group's line, then click the Group permissions icon (image of a shield). The permission table of that group will be showed up.
There are:
Each line, there will be 4 option: View , Add, Edit, Delete
Just check 1, 2, or 3 options without the first option, then click Save button

What is the expected result?

The selected options should be saved. For example, I just want adding and Editing

What do you get instead? (A Screenshot can help us a lot!)

Every option become unchecked, that's mean no option applied.

LUYA Check ouput (run this script and post the result: luyacheck.php)

1: [in_array('mod_rewrite', apache_get_modules())] true
2: [ini_get('short_open_tag')] ''
3: [ini_get('error_reporting')] '22527'
4: [phpversion()] '7.1.13'
5: [php_ini_loaded_file()] '/etc/opt/remi/php71/php.ini'
6: [php_sapi_name()] 'apache2handler'
7: [isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : unknown] 'Apache/2.2.15 (CentOS)'

Additional infos

Q A
LUYA Version 1.3.1
@mrtrinhvn mrtrinhvn changed the title Cannot save permission without view option Cannot save permission without the view option May 25, 2020
@mrtrinhvn mrtrinhvn changed the title Cannot save permission without the view option Cannot save permissions without the view option May 25, 2020
@nadar
Copy link
Member

nadar commented May 26, 2020

Thanks for the report, i will do some tests.

@nadar
Copy link
Member

nadar commented May 26, 2020

(I also want to say, if you enable only edit and update for a certain item, you won't see this menu entry, so you are not able to click in the admin menu, but for api users - this makes sense)

@mrtrinhvn
Copy link
Author

mrtrinhvn commented May 27, 2020

I want to show Just the Entry menu for Benhnhan
If in Module.php
public function getMenu()
{
return (new \luya\admin\components\AdminMenuBuilder($this))
->node('Bệnh nhân', 'local_library')
->group('Các nội dung')
->itemApi('Bệnh nhân', 'thongtinbenhnhanadmin/benhnhan/index', 'account_box', 'api-thongtinbenhnhan-benhnhan');
//->itemApi('Phiếu theo dõi', 'thongtinbenhnhanadmin/phieutheodoi/index', 'receipt', 'api-thongtinbenhnhan-phieutheodoi');
}

I have public functions in the Benhnhan model

_
public ngRestRelations()
{
...
'targetModel' => \app\modules\thongtinbenhnhan\models\Phieutheodoi::class,
...
}
public function getPhieu()
{
return $this->hasMany(Phieutheodoi::class, ['benhnhan_id' => 'id']);
}
..._

The problem will be show as below:
Invalid Configuration – yii\base\InvalidConfigException
The configured api relation 'api-thongtinbenhnhan-phieutheodoi' does not exists in the menu elements. Maybe you have no permissions to access this API.

@nadar
Copy link
Member

nadar commented May 27, 2020

yes, maybe we should then just hide the relations button.

@nadar nadar transferred this issue from luyadev/luya Jul 21, 2020
@nadar nadar self-assigned this Jul 21, 2020
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