Revision 60e27535

View differences:

src/oca/java/src/org/opennebula/client/acl/Acl.java
52 52
        tmpUsers.put("#", 0x0000000100000000L);
53 53
        tmpUsers.put("@", 0x0000000200000000L);
54 54
        tmpUsers.put("*", 0x0000000400000000L);
55
        tmpUsers.put("%", 0x0000000800000000L);
55 56

  
56 57
        USERS = Collections.unmodifiableMap(tmpUsers);
57 58

  
......
339 340
     */
340 341
    private static long calculateIds(String id) throws RuleParseException
341 342
    {
342
        if( !id.matches("^([#@]\\d+|\\*)$") )
343
        if( !id.matches("^([#@%]\\d+|\\*)$") )
343 344
        {
344 345
            throw new RuleParseException("ID string '" + id + "' malformed");
345 346
        }
src/oca/java/test/AclTest.java
157 157
            "* VM+IMAGE+TEMPLATE/@100 CREATE+USE",
158 158
            "#2345 VM+IMAGE+TEMPLATE/* CREATE+USE",
159 159
            "@7 HOST/@100 USE+MANAGE",
160
            "* HOST+DATASTORE/%100 MANAGE+USE",
161
            "@107 NET/%100 USE"
160 162
        };
161 163

  
162 164
        long[] users = {
......
165 167
            0x20000006bL,
166 168
            0x400000000L,
167 169
            0x100000929L,
168
            0x200000007L
170
            0x200000007L,
171
            0x400000000L,
172
            0x20000006bL
169 173
        };
170 174

  
171 175
        long[] resources = {
......
174 178
            0x28200000064L,
175 179
            0x29200000064L,
176 180
            0x29400000000L,
177
            0x2200000064L
181
            0x2200000064L,
182
            0x102800000064L,
183
            0x4800000064L
178 184
        };
179 185

  
180 186
        long[] rights = {
......
183 189
            0x1L,
184 190
            0x9L,
185 191
            0x9L,
186
            0x3L
192
            0x3L,
193
            0x3L,
194
            0x1L
187 195
        };
188 196

  
189 197
        for( int i = 0; i < rules.length; i++ )
......
254 262
                "#3 TEMPLATE+HOS/#0 USE",
255 263
                "#3 /#0 USE",
256 264
                "#3 TEMPLATE/# USE",
265
                "#3 TEMPLATE/% USE",
257 266
                "#3 TEMPLATE/#5 USE CREATE",
258 267
                "#3 TEMPLATE/#5",
259 268
                "#3     ",

Also available in: Unified diff