Problem mit privaten Unteralben

Phoca Gallery - image gallery extension
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Problem mit privaten Unteralben

Post by mizapf »

Hallo zusammen,

jetzt muss ich doch mal fragen, denn mittlerweile bin ich komplett verwirrt, oder es funktioniert anders, als ich denke.

Also: Typische Situation, ich habe mehrere Fotoalben, wobei es jeweils Bilder gibt, die nur für bestimmte Nutzer einsehbar sein sollen. Ich lege diese Bilder in eine Unterkategorie * - privat, also z.B. "Spanien - privat" und "USA - privat". Dabei sollen Leute, die in "Spanien - privat" reinschauen dürfen, natürlich nicht direkt das Recht haben, auch "USA - privat" zu öffnen.

Ich habe zwei Nutzer A und B, und A darf in "Spanien - privat" rein, B hingegen in "USA - privat"; beide dürfen alle anderen öffentlichen Bilder sehen. Dazu definiere ich die Gruppen "spanien_privat_gr" und "usa_privat_gr" und ordne A der ersten, B der zweiten Gruppe zu. Die Gruppen sind beide Untergruppen von "Photo", diese ihrerseits von "Registered".

Dann, so habe ich das verstanden, brauche ich passende Access Levels, um den Zugriff auf die Phoca-Kategorien zu beschränken. Also definiere ich als Access Levels (Zugriffsebenen) "spanien_privat" und "usa_privat" und gewähre den privat-Gruppen die passenden privat-Zugriffsebenen.

Dann öffne ich die Kategorie in Phoca und setze in der Kategorie "Spanien - privat" die Zugriffsebene "spanien_privat", entsprechend beim anderen Album.

Mein Problem ist: Wenn sich nun im Frontend ein Nutzer einloggt (A oder B), bekommt er stets Zugriff auf beide privaten Alben, obwohl die Gruppen voneinander nichts erben.

Wenn ich noch die Nutzernamen bei "Access Rights" explizit eintrage (A oder B), dann funktioniert es wie gewünscht, aber welchen Sinn haben dann die Access Levels? Ich habe gemerkt, dass ich sogar die Access Levels absichtlich falsch eintragen kann, aber es praktisch keine Auswirkung hat - so als ob nur "Access Rights" beachtet würden.

Übrigens funktionieren die Access Levels im übrigen Joomla, d.h. ich kann Menüeinträge nutzerabhängig darstellen.

Viele Grüße
Michael

Joomla 3.8.0
Phoca Gallery 4.3.6
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Re: Problem mit privaten Unteralben

Post by mizapf »

I'l better add an English translation here:

I'm pretty confused about the access levels together with Phoca Gallery, or things are supposed to be used in a different way than I thought.

Situation: I have two photo albums, one about Spain, one about USA, and I want to grant public access to both except for some photos that shall only be accessed by people that were traveling with me. I set up the categories "Spain" and "USA", and subcategories "Spain - private" and "USA - private". Also assume that user A shall be able to view "Spain - private", while user B shall be able to view "USA - private".

So I created the groups "spain-private-group" and "usa-private-group", and added user A to the first, user B to the second group. The groups are subgroups of "Photo", which is a subgroup of "Registered".

Then I understood that I need access levels to restrict the access to the private categories. For this reason I actually created those groups first. Then I had "spain_private" and "usa_private" as custom levels, and "spain-private-group" may gain the "spain_private" level, and "usa-private-group" gets "usa_private".

Next, I assigned the levels "spain_private" to the category "Spain - private" and "usa_private" to "USA - private".

Now that seemed still logical to me. When I am not logged in (public user), I can see neither of these private categories. However, when I log in as A, I can view both private groups, the same is true for B.

So I revisited the category settings and found "Access rights" with nothing filled in. So I added the users A resp. B in that field, and this turned out to work as expected: Only A can see "Spain - private", and only B can see "USA - private". But what are the access levels used for?

Just for curiosity I swapped the levels (which does not make sense), and nothing changed: Although A was then in a group that did not have the access level "spain_private", I could still view the album "Spain - private" despite the requested access level.

What's wrong here?

By the way, outside of Phoca, the access levels seem to work as expected: I assigned the spain_private level to a menu item, and it only showed up for A.

Greetings,

Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem mit privaten Unteralben

Post by Jan »

Hi,

first, the access rights are set for categories only, not for images (this will be hard for server to check e.g. 100 rights on site with images and combine them with group rights, menu link rights and other rights)

Second - each category has own rights - You can set Access for groups but you can make it more detailed and select only one or more users from the selected group.

So users can see the category only if they hare rights - if they are in the access group or if they are selected in access rights (users only)

https://www.phoca.cz/documents/2-phoca- ... ess-rights

Jan
If you find Phoca extensions useful, please support the project
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Re: Problem mit privaten Unteralben

Post by mizapf »

Hi Jan,

thanks for your explanation. That is basically how I understood it, but it did not work as expected. Also, your link points to frontend upload; I was talking about backend operations, so the explanations do not fully match.

Could you (or someone else) please summarize how to approach this task? That means: You have three albums A1, A2, A3, two users U1 and U2, both users may view A3, but only U1 can access A1, and only U2 can access A2. Specifically: What access levels or user groups should I set up?

Thanks

Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem mit privaten Unteralben

Post by Jan »

Hi,

not sure if I understand correctly:
both users may view A3, but only U1 can access A1, and only U2 can access A2
view = access

So:
Access rights for A3: Access: Registered, Access Rights: User U1, User U2
Access rights for A1: Access: Registered, Access Rights: User U1
Access rights for A2: Access: Registered, Access Rights: User U2


Jan
If you find Phoca extensions useful, please support the project
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Re: Problem mit privaten Unteralben

Post by mizapf »

(yes, view=access)

OK, that means that I should control access to the albums via the access rights, not via the access level (which is always "Registered"). That is, I have to put the names of all users with access to that album in the access rights field, right?

I thought, from reading about access levels, that the access is mainly controlled by the access levels. I'm thinking about a situation where I already put users into a group (e.g. my USA travel group) within the remaining Joomla, and then I'd expect that I can grant access to all members of that group.

Greetings,

Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem mit privaten Unteralben

Post by Jan »

Hi, in Access you control the groups, but if you want to make it more in details, you can use Access levels to select users from the group.

Access - you want to limit it to group
Access level - you want to limit it to group but inside the group you only want to limit to some users.

Jan
If you find Phoca extensions useful, please support the project
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Re: Problem mit privaten Unteralben

Post by mizapf »

Hi Jan,

thanks again for your explanation. As you describe it, it is the way that I actually understood it, but this is not how it seems to work for me. I simplified the scenario, and I set up a website for demonstration:

https://www.mizapf.de/

There are two users:
"friend" (password abc123), member of the groups "Registered" and "Friends"
"user" (password 321cba), member of the group "Registered"

The access level "Private" is granted to the group "Friends" only.

There are two categories: Public images, linked via "Public Pics", is open to public. Private images, linked via "Private pics", requires private access level. Also, there is an article that requires private access level. Suppose that I want only close friends to have access to the album and to the article, among all the other registered users.

Now try the public access, then log in as "friend" and then again as "user". As "friend", you have access to everything. But you can see that Phoca grants access to the private pics to "user" as well, despite the fact that the category is reserved to "Private" access level. Joomla, on the other hand, correctly blocks access to the article to user.

Greetings,

Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problem mit privaten Unteralben

Post by Jan »

Hi, can you send me the screenshot of settings of album "private pics"?

Is the Friends group not a part of "Registered" group?

Jan
If you find Phoca extensions useful, please support the project
mizapf
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 29 Sep 2017, 00:58

Re: Problem mit privaten Unteralben

Post by mizapf »

I could send you an administrator login to the backend by E-mail; it is still nothing more than a playground.
Post Reply