-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Krzysztof <krzysztof.wielocha@nask.pl>
- Loading branch information
Showing
32 changed files
with
924 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { fromPlugin } from "../extensions"; | ||
|
||
export const Capability = { | ||
manageUsers: "manage_users", | ||
shareQueriedObjects: "share_queried_objects", | ||
accessAllObjects: "access_all_objects", | ||
sharingObjects: "sharing_objects", | ||
addingTags: "adding_tags", | ||
removingTags: "removing_tags", | ||
addingComments: "adding_comments", | ||
removingComments: "removing_comments", | ||
addingParents: "adding_parents", | ||
removingParents: "removing_parents", | ||
readingAllAttributes: "reading_all_attributes", | ||
addingAllAttributes: "adding_all_attributes", | ||
managingAttributes: "managing_attributes", | ||
removingAttributes: "removing_attributes", | ||
addingFiles: "adding_files", | ||
addingConfigs: "adding_configs", | ||
addingBlobs: "adding_blobs", | ||
unlimitedRequests: "unlimited_requests", | ||
removingObjects: "removing_objects", | ||
manageProfile: "manage_profile", | ||
personalize: "personalize", | ||
}; | ||
|
||
export let capabilitiesList = { | ||
[Capability.manageUsers]: | ||
"Managing users and groups (system administration)", | ||
[Capability.shareQueriedObjects]: "Query for all objects in system", | ||
[Capability.accessAllObjects]: | ||
"Has access to all new uploaded objects into system", | ||
[Capability.sharingObjects]: "Can share objects with all groups in system", | ||
[Capability.addingTags]: "Can add tags", | ||
[Capability.removingTags]: "Can remove tags", | ||
[Capability.addingComments]: "Can add comments", | ||
[Capability.removingComments]: "Can remove (all) comments", | ||
[Capability.addingParents]: "Can specify parent of uploaded object", | ||
[Capability.removingParents]: | ||
"Can remove parent of object and inherited permissions from that relation", | ||
[Capability.readingAllAttributes]: | ||
"Has access to all attributes of object (including hidden)", | ||
[Capability.addingAllAttributes]: "Can add all attributes to object", | ||
[Capability.managingAttributes]: | ||
"Can define new attributes and manage them", | ||
[Capability.removingAttributes]: "Can remove attribute from objects", | ||
[Capability.addingFiles]: "Can upload files", | ||
[Capability.addingConfigs]: "Can upload configs", | ||
[Capability.addingBlobs]: "Can upload text blobs", | ||
[Capability.unlimitedRequests]: | ||
"API requests are not rate-limited for this group", | ||
[Capability.removingObjects]: "Can remove objects", | ||
[Capability.manageProfile]: "Can manage own profile", | ||
[Capability.personalize]: "Can mark favorites and manage own quick queries", | ||
}; | ||
|
||
for (let extraCapabilities of fromPlugin("capabilities")) { | ||
capabilitiesList = { ...capabilitiesList, ...extraCapabilities }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { AuthContext } from "./context"; | ||
export { AuthProvider } from "./provider"; | ||
export { Capability, capabilitiesList } from "./capabilities"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
|
||
export default function GroupBadge({ group }) { | ||
return ( | ||
<Link | ||
to={ | ||
group.private | ||
? `/profile/user/${group.name}` | ||
: `/profile/group/${group.name}` | ||
} | ||
> | ||
<span | ||
className={`badge badge-${ | ||
group.private ? "primary" : "secondary" | ||
}`} | ||
> | ||
{group.name} | ||
</span> | ||
</Link> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.