developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#1016 closed enhancement (fixed)

jAcl2Db: support named groups

Reported by: Julien Owned by: Julien
Priority: normal Milestone: Jelix 1.3 beta 1
Component: jelix:acl Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: yes
Hosting Provider: Php version:

Description

I need a way to get a specific group and I cannot use the id, as it's auto increment (an so is not a constant).

Example : in a recruitment app, I have a soap method to create a recruiter account. I need to put the user in the "recruiters" group.

Note: I could have made a separate db table to keep the existing schema unchanged, but I think it's better that way. Let me know if I'm wrong.

Attachments (1)

1016-jAcl2Db-support-named-groups.diff (5.4 KB) - added by Julien 9 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Julien

comment:1 follow-up: Changed 9 years ago by laurentj

why not using the 'name' field ?

comment:2 in reply to: ↑ 1 Changed 9 years ago by Julien

  • Status changed from new to assigned

Replying to laurentj:

why not using the 'name' field ?

because it can be changed in the admin module, and so it would break the app.

I see the "name" field as a "human readable" identifier but the "code" will be a programmatic reference.

If the idea is ok, I will add a warning when trying to delete a group which has a code.

comment:3 Changed 8 years ago by Julien

Hello,

any more advice about this suggestion ?

I need to know if I can still use it in my apps or if I should do it another way.

thanks

comment:4 Changed 8 years ago by laurentj

  • review changed from review? to review+

ok why not for this field.. In the future (Jelix 2), perhaps it will be better to have this code field as a primary key...

comment:5 Changed 8 years ago by Julien

committed in the trunk (http://hg.jelix.org/jelix/jelix-trunk/rev/a7c7461b59d7)

still open because I have to complete the patch with a check in the admin UI when deleting a named group.

About using this code as primary key, Im' not sure, as users still need the ability to create groups on the fly (with the admin UI). Also personal groups do not require a code. So I think it's better to stick with an autoincrement. We could set it as UNIQUE btw.

comment:6 Changed 8 years ago by laurentj

any news ?

comment:7 Changed 8 years ago by laurentj

  • Milestone changed from Jelix 1.2 beta to Jelix 1.2

comment:8 Changed 8 years ago by laurentj

  • Milestone changed from Jelix 1.2 to Jelix 1.3

I think that we could remove this numerical id (and with the new upgrade system, it will be easy to migrate :) ) But no more time for 1.2.

comment:9 Changed 7 years ago by laurentj

  • Resolution set to fixed
  • Status changed from assigned to closed

The numerical id is now removed. https://bitbucket.org/jelix/jelix-trunk/changeset/e89dcecaf3dd . The admin management is less annoying. And we don't have anymore problems with the anonymous group (some databases or operations do not like 0 as a value on an autoincremented id).

For groups generated dynamically, an alphanumerical identifier is not so difficult to generate by hand.

comment:10 Changed 7 years ago by laurentj

  • Documentation needed set
Note: See TracTickets for help on using tickets.