-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add getting groups and users with given access rights for Pagure (#834)
Add getting groups and users with given access rights for Pagure Needed for packit/packit#2088 RELEASE NOTES BEGIN For Pagure there are 2 new methods available: one for getting users with specified access rights and one for getting members of a group. RELEASE NOTES END Reviewed-by: Nikola Forró Reviewed-by: Laura Barcziová
- Loading branch information
Showing
11 changed files
with
1,279 additions
and
156 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
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,24 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT | ||
|
||
import logging | ||
|
||
from ogr.services import pagure as ogr_pagure | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class PagureGroup: | ||
service: "ogr_pagure.PagureService" | ||
|
||
def __init__(self, name: str, raw_group: dict) -> None: | ||
self.name = name | ||
# see https://pagure.io/api/0/#groups-tab | ||
self._raw_group = raw_group | ||
|
||
def __str__(self) -> str: | ||
return f'PagureGroup(name="{self.name}")' | ||
|
||
@property | ||
def members(self) -> list[str]: | ||
return self._raw_group["members"] |
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.