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

Unadvertised resources #9583

Closed
1 of 6 tasks
tdipisa opened this issue Oct 12, 2023 · 16 comments · Fixed by geosolutions-it/geostore#332, #9962 or #9984
Closed
1 of 6 tasks

Unadvertised resources #9583

tdipisa opened this issue Oct 12, 2023 · 16 comments · Fixed by geosolutions-it/geostore#332, #9962 or #9984
Assignees
Milestone

Comments

@tdipisa
Copy link
Member

tdipisa commented Oct 12, 2023

Description

Include the possibility to have unadvertised resources in MS: maps, dashboards and geostories (app contexts are excluded for now).

From the Edit properties panel of a resource it is possible for the admin/owner to make a resource unadvertised. Doing that, the resource will appear in the Home page or in the Map Catalog tool only for admin users or the owner (as per usual behaviour admins can change that setting for all resources and normal users only for their own resources).

image

For other users accessing the resources directly (e.g. that can open the Edit Properties within it), we can consider to include a notifications simply to inform that the resource is Unadvertized so that they can be aware of this (for example the same as above screenshot but with the checkbox disabled).

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Other useful information

@offtherailz
Copy link
Member

offtherailz commented Nov 15, 2023

I think there are some typos in this issue that make us difficoult to understand.

From my undestanding it is asking for "Unadvertized" resources not listed in Home and not listed in the Map Catalog plugin.
In this case @tdipisa I suggest to use permalinks for this purpose. Does this satisfy the requirement? They are already not listed in maps or in Map catalog, because they belong to a different, separated category.

@tdipisa
Copy link
Member Author

tdipisa commented Nov 15, 2023

I think there are some typos in this issue that make us difficoult to understand.
From my undestanding it is asking for "Unadvertized" resources not listed in Home and not listed in the Map Catalog plugin.

I've updated a bit the description to make it clearer. That's the point anyway, what is difficult tu understand here?

In this case @tdipisa I suggest to use permalinks for this purpose. Does this satisfy the requirement? They are already not listed in maps or in Map catalog, because they belong to a different, separated category.

Why using permalinks should satisfy the requirements that are asking for a completely different thing? Unadvertized resources must be anyway visible in MS Catalog but only for admins.

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 20, 2023

@tdipisa
Kindly clarify
So the Unadvertised flag takes precedence over group permission? (i.e when the resource is Unadvertised, and group permission is everyone with can view/edit, it is still ignored and treated as a private resource)

@tdipisa
Copy link
Member Author

tdipisa commented Nov 20, 2023

@tdipisa Kindly clarify So the Unadvertised flag takes precedence over group permission? (i.e when the resource is Unadvertised, and group permission is everyone with can view/edit, it is still ignored and treated as a private resource)

@dsuren yes, I think this from description make it already quite clear:

Doing that, the resource will appear in the Home page or in the Map Catalog tool only for admin users or the owner

isn't it?

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 20, 2023

So in that case, wouldn't it be better that we disable the group permission options when unadvertised field is checked ?

@tdipisa
Copy link
Member Author

tdipisa commented Nov 20, 2023

No, nothing should change for this.

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 20, 2023

Okay. Thanks

@offtherailz
Copy link
Member

offtherailz commented Dec 15, 2023

@tdipisa I had a sync with @dsuren1 about this task.
For our investigation we absolutely need a backend support for this feature.
Actual filtering support on client side is not enough for providing this functionality.

@tdipisa
Copy link
Member Author

tdipisa commented Dec 15, 2023

Blocked waiting for further evaluations on the backend.

@tdipisa tdipisa added New Feature used for new functionalities and removed enhancement labels Dec 19, 2023
@tdipisa tdipisa assigned offtherailz and unassigned dsuren1 Dec 19, 2023
@afabiani
Copy link
Member

@tdipisa this issue is currently blocked by this

@afabiani
Copy link
Member

@tdipisa @offtherailz PR for the backend available here

@tdipisa
Copy link
Member Author

tdipisa commented Jan 17, 2024

Thank you @afabiani. @offtherailz will review asap.

@offtherailz
Copy link
Member

offtherailz commented Jan 26, 2024

Reporting usage info

Basically you have to add to POST/PUT requests for create/edit the resource adding the advertised tag in the request XML.
Here below some examples verified working on geostore from pr geosolutions-it/geostore#332 :

  • Create (POST):
<Resource>
    <description>
        <![CDATA[]]>
    </description>
    <metadata></metadata>
    <name>
        <![CDATA[test-save-unadvertised]]>
    </name>
    <advertised>
        false
    </advertised>
    <category>
        <name>MAP</name>
    </category>
    <Attributes>
        <attribute>
            <name>attributes</name>
            <value>null</value>
            <type>STRING</type>
        </attribute>
    </Attributes>
    <store>
        <data>
// DATA
        </data>
    </store>
</Resource>
  • Update (PUT) (essential is the body) can contain advetised tag. If not present, it will be set to true
<Resource>
    <description>
        <![CDATA[]]>
    </description>
    <metadata></metadata>
    <name>
        <![CDATA[a]]>
    </name>
    <advertised>
        false
    </advertised>
</Resource>

I also added an example here:

https://github.com/geosolutions-it/geostore/wiki/REST-API-examples

@tdipisa
Copy link
Member Author

tdipisa commented Feb 2, 2024

@Igi-ID (FYI @offtherailz)
GeoStore PR geosolutions-it/geostore#332 has been merged, therefore we can proceed implementing the front-end part. Thank you.

@tdipisa tdipisa reopened this Feb 2, 2024
@offtherailz
Copy link
Member

offtherailz commented Feb 7, 2024

@tdipisa just a clarification for this:

tool only for admin users or the owner (as per usual behaviour admins can change that setting for all resources and normal users only for their own resources).

In our case I think this checkbox should be show to everyone that can edit the resource, that is consistent with the rest of the model.
Alternative informations we have on the resource are:

  • owner: actually an attribute, so not secure information (everyone with edit permission can edit this), and also the semantics of this attribute is not sure.
  • creator: user that created the resource
  • editor: user that last edited the resource

Please confirm that unadvertised should be shown to every user that have edit permissions on it.

@tdipisa
Copy link
Member Author

tdipisa commented Feb 7, 2024

In our case I think this checkbox should be show to everyone that can edit the resource, that is consistent with the rest of the model.
Please confirm that unadvertised should be shown to every user that have edit permissions on it.

Confirmed @offtherailz @Igi-ID AC not so well expressed, it seems.

@Igi-ID Igi-ID linked a pull request Feb 8, 2024 that will close this issue
5 tasks
@Igi-ID Igi-ID removed a link to a pull request Feb 8, 2024
5 tasks
@Igi-ID Igi-ID linked a pull request Feb 8, 2024 that will close this issue
5 tasks
offtherailz pushed a commit that referenced this issue Feb 9, 2024
Added unadvertised field in Metadata.jsx, shown in modal form. Checkbox, controlled.
Adjust handleResourceData.jsx enhancer, include unadvertised field from resource originalData unto props passed to Metadata.jsx.

Added translations for unadvertised field.
@ElenaGallo ElenaGallo self-assigned this Feb 15, 2024
@tdipisa tdipisa removed the Accepted label Feb 15, 2024
@tdipisa tdipisa reopened this Feb 16, 2024
@Igi-ID Igi-ID linked a pull request Feb 21, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment