1
luciorota
Module permissions
  • 2019/4/11 19:47

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Hi fellas!
Do you know if has anyone tried to move the definition of permissions in the 'xoops_version.php' file?

example
/ ------------------- Perms ------------------- //
$i 0;

$modversion['gperm'] = array();

$modversion['gperm'][] = [
    
'name' => 'itemR',
    
'title' => '_MI_PERM_ITEMR',
    
'description' => '_MI_PERM_ITEMR_DESC',
    
'itemid' => true,
    
'trueifadmin' => true,
    
'category' => ''
];
$modversion['gperm'][] = [
    
'name' => 'itemW',
    
'title' => '_MI_PERM_ITEMW',
    
'description' => '_MI_PERM_ITEMW_DESC',
    
'itemid' => true,
    
'trueifadmin' => true,
    
'category' => ''
];
$modversion['gperm'][] = [
    
'name' => 'itemRW',
    
'title' => '_MI_PERM_ITEMrW',
    
'description' => '_MI_PERM_ITEMRW_DESC',
    
'itemid' => true,
    
'trueifadmin' => true,
    
'category' => ''
];
$modversion['gperm'][] = [
    
'name' => 'print',
    
'title' => '_MI_PERM_PRINT',
    
'description' => '_MI_PERM_PRINT_DESC',
    
'itemid' => false,
    
'trueifadmin' => true,
    
'category' => ''
];

2
Mamba
Re: Module permissions
  • 2019/4/12 8:48

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


I'm not aware of anybody trying that....
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
geekwright
Re: Module permissions

Quote:

luciorota wrote:
Hi fellas!
Do you know if has anyone tried to move the definition of permissions in the 'xoops_version.php' file?...
Interesting. My first thought was driving an automated permissions page, similar to the about page:
$moduleAdmin->displayPermissions();


I would like to hear more about what you were thinking.

4
Mamba
Re: Module permissions
  • 2019/4/13 5:18

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Actually, Goffy has included permissions as part of the "sample data" in wgGallery, i.e. when the user imports the "sample data", the module permissions will be included automatically:
https://github.com/ggoffy/wggallery/commit/44e5e0f473941bff59fe50c3c174a4ad320a5cdf

One of the items on my wish list was to have an easy solution for backing up data and all module preferences and permissions, and be able to upload them as needed, which would then make it easier to move the whole module between websites because you could keep your original settings and your data.

I've done it now for the "sample data", i.e. I can save my current module data as a "sample data" and then let the other users to simply import it. That helps me and other users to test modules, as we can make sure that we're using the same data and we can replicate any potential issues.

Now that Goffy added the "read" routine for permissions, we'll need to write a routine to save the current permissions, and then we can easily transfer modules between XOOPS installations, without having to deal with the database directly...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

5
luciorota
Re: Module permissions
  • 2019/4/13 14:18

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Quote:

...driving an automated permissions page, similar to the about page


That's exactly what I'm looking for!

2 or more kind of permissions:
- "global permissions" for example: print, user extendee editor, ...
- "per item permissions" for example: read or write into a category, ...
- ...

Login

Who's Online

175 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 175


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits