Update of /cvsroot/sandweb/sandweb/lib/SandWeb
In directory sc8-pr-cvs1:/tmp/cvs-serv9806/lib/SandWeb
Modified Files:
Repository.pm
Log Message:
* started implementing groups for valid VCS commands
Index: Repository.pm
===================================================================
RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -U2 -r1.52 -r1.53
--- Repository.pm 1 Apr 2003 02:46:26 -0000 1.52
+++ Repository.pm 8 Jul 2003 23:21:23 -0000 1.53
@@ -2492,4 +2492,16 @@
}
+# FIXME needs documentation
+
+sub get_vcs {
+ my $self = shift;
+ if ($self->{'vcs'}) {
+ return \$self->{'vcs'};
+ }
+ else {
+ return 0;
+ }
+}
+
=head1
@@ -2526,31 +2538,47 @@
=cut
-sub get_vcs {
+sub get_vcs_commands {
my $self = shift;
- if ($self->{'vcs'}) {
- return \$self->{'vcs'};
- }
- else {
+ my %args = @_;
+
+ my $group = $args{'group'} || '';
+
+ if ($group eq 'read-only'){
+ return (
+ 'annotate',
+ 'diff',
+ 'editors',
+ 'history',
+ 'log',
+ 'status',
+ 'update',
+ );
+
+ } elsif ($group eq 'simple'){
+ return(
+ 'add',
+ 'commit',
+ 'update',
+ );
+ } elsif ($group eq 'all'){
+ return (
+ 'add',
+ 'annotate',
+ 'branch',
+ 'commit',
+ 'diff',
+ 'edit',
+ 'editors',
+ 'history',
+ 'log',
+ 'remove',
+ 'status',
+ 'tag',
+ 'unedit',
+ 'update',
+ );
+ } else {
return 0;
}
-}
-
-sub get_vcs_commands {
- return (
- 'add',
- 'annotate',
- 'branch',
- 'commit',
- 'diff',
- 'edit',
- 'editors',
- 'history',
- 'log',
- 'remove',
- 'status',
- 'tag',
- 'unedit',
- 'update',
- );
}
|