Permissions

Overview

gityar provides granular permission control at multiple levels: repository, team, and organization. Understanding permissions is crucial for maintaining security while enabling collaboration.

Permission Levels

Repository Level

Read Access

  • View repository contents
  • Clone repository
  • View issues and pull requests
  • Comment on issues and PRs
  • View wiki
  • Download releases

Write Access

  • All Read permissions
  • Push to repository
  • Create and manage branches
  • Create and manage issues
  • Create and manage pull requests
  • Add labels and milestones
  • Edit wiki pages
  • Manage releases

Admin Access

  • All Write permissions
  • Change repository settings
  • Manage collaborators
  • Delete repository
  • Transfer ownership
  • Manage webhooks
  • Manage Git hooks
  • Enable/disable features (Wiki, Issues, etc.)
  • Manage deploy keys

Organization Level

Owner

  • Full control over organization
  • Manage organization settings
  • Create and delete repositories
  • Manage all teams
  • Add and remove members
  • Manage organization billing (if applicable)

Member

  • Access assigned team repositories
  • Create repositories (if allowed)
  • Participate in teams
  • View organization page

Setting Permissions

Individual Repository

  1. Go to repository Settings
  2. Click "Collaboration"
  3. Search for user
  4. Select permission level:
    • Read
    • Write
    • Admin
  5. Click "Add"

Via Teams

  1. Go to organization Teams
  2. Select or create team
  3. Set team permission level
  4. Add members to team
  5. Grant repository access to team

Organization Settings

Repository Creation:

  • Allow all members to create repositories
  • Restrict to owners only

Team Creation:

  • Allow all members to create teams
  • Restrict to owners only

Special Permissions

Branch Protection

Protect important branches (like main):

  1. Go to SettingsBranches
  2. Add branch protection rule
  3. Configure:
    • Require pull request reviews
    • Require status checks
    • Require signed commits
    • Restrict who can push

Deploy Keys

Allow read or read-write access for deployment:

  1. Go to SettingsDeploy Keys
  2. Click "Add Deploy Key"
  3. Add SSH public key
  4. Choose:
    • Read-only: Can only pull
    • Read-Write: Can push and pull

Personal Access Tokens

Granular permissions for API access:

  • read:user - Read user profile
  • write:user - Modify user profile
  • read:repo - Read repository
  • write:repo - Modify repository
  • delete:repo - Delete repository
  • read:org - Read organization
  • write:org - Modify organization

Permission Inheritance

Hierarchy

Organization
  └─ Team
      └─ Repository
          └─ Individual

Rules

  • Individual permissions override team permissions
  • Team permissions apply to all team members
  • Organization owners have admin access to all repositories
  • Most restrictive permission applies when multiple sources exist

Best Practices

Security

  • ✅ Principle of least privilege
  • ✅ Regularly audit permissions
  • ✅ Remove access when no longer needed
  • ✅ Use teams instead of individual permissions
  • ✅ Enable branch protection for main branches
  • ✅ Require PR reviews for important changes

Collaboration

  • ✅ Document permission structure
  • ✅ Create teams by function or project
  • ✅ Use Read access for external contributors
  • ✅ Use Write access for trusted developers
  • ✅ Reserve Admin for repository maintainers

Organization Management

  • ✅ Limit number of organization owners
  • ✅ Review team memberships quarterly
  • ✅ Archive inactive repositories
  • ✅ Document access policies
  • ✅ Train team members on permissions

Troubleshooting

Common Issues

"Permission Denied" when pushing:

  • Check you have Write or Admin access
  • Verify you're using correct credentials
  • Check if branch is protected

Can't see repository:

  • Verify you've been added as collaborator
  • Check team membership
  • Ask organization owner for access

Can't delete repository:

  • Only Admin or Owner can delete
  • Check if repository is organization-owned

Can't add collaborators:

  • Need Admin access to repository
  • Organization owners can add to any repository

Next Steps