Skip to content

Commit 800822d

Browse files
authored
feat(access): iterating over projects and add user
1 parent 8eb9526 commit 800822d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

accessManagement.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
urls = [
2+
"https://glabInstance:glabPort/XXXX,
3+
"https://glabInstance:glabPort/XXXX,
4+
"https://glabInstance:glabPort/XXXX,
5+
"https://glabInstance:glabPort/XXXX
6+
]
7+
8+
9+
user = User.find_by(username: "toufa7")
10+
11+
urls.each do |link|
12+
project = Project.find_by_full_path(link)
13+
if project
14+
project.add_member(user, Gitlab::Access::DEVELOPER, expires_at: 2.weeks.from_now.to_date)
15+
else
16+
puts "Project not found for URL: #{link}"
17+
end
18+
end

0 commit comments

Comments
 (0)